Truncated JSON output from emscripten binary with viaIR: true
and both ir
and *
selected as outputs
#14362
Labels
bug 🐛
medium effort
Default level of effort
medium impact
Default level of impact
must have
Something we consider an essential part of Solidity 1.0.
should compile without error
Error is reported even though it shouldn't. Source is fine.
solcjs
The snippet from #14361 has one more weird effect that looks unrelated to that issue. When I select
*
output together withir
, enableviaIR
and pass it to the emscripten binary, the produced JSON is truncated.It only happens when these outputs are both selected at the same time. Changing the snippet to something simple like
contract {}
resolves the problem as well so it's something in the code that triggers it. Unlike in #14361, this happens both with and without optimizer.It's possible that
solc-js
crashes in the process, but there's nothing in the output that would indicate that (noKilled
orcore dumped
on the console). The fact that it always cuts off at the same point would also indicate that it's the JSON generation that suddenly decides to stop for whatever reason, but then successfully outputs that unfinished content.Environment
Tested with
solc-js
0.8.20 with the binary included in the release.Repro
input.json
Script
Output
The output from
jq
is:which means that the produced JSON is malformed. And indeed, this is how it ends:
}\n\n function write_to_memory_t_bytes1(memPtr, value) {\n mstore(memPtr, cleanup_t_bytes1(value))\
This is the content of the
ir
field, which is not terminated. The Standard JSON output just ends abruptly in the middle of it.The text was updated successfully, but these errors were encountered: