Open undisbeliever opened 2 years ago
I also ran into this same exact issue, with the same assert with the same stack trace.
Here's a different repro that more closely matches how I bumped into this problem:
bank code @ 0x8000 : [constdata; 0x8000];
in code {
var test : u8 in y;
}
This assert is partially blocking me working on patches to fix the other bugs I've reported.
To work around the problem locally, I'm doing a <xyz>.hasValue ? <xyz>.get() : 0
in each of the places where I am experiencing an assert. I seem to be getting the same binary results out, so that seems to be an okay workaround for now. When I tried just commenting out the assert, it seemed to access random data from memory and ended up with a super large storage size and not zero (and thus not successfully finishing the compile). So I'm not sure what a release build does in this case.
Here's my patch. I don't know that passing a storage size of 0 is the right behavior, nor that it matches what happens in a release build (when the assert doesn't fire, but it doesn't generate a giant binary either), so that's why I'm not submitting it as a PR.
I can submit it if that is determined to be the right fix tho, if you like. Please let me know.
Minimal reproducible test case:
The test will compile successfully (with
test
pointing to the correct address) if thein code {
line is replaced within ram {
.