Potential bug in compiler: local variable read before written in generated code
https://github.com/dfinity/motoko/blob/0b05b2428fcf427ba58fa70223dd587f18d21dce/src/codegen/compile.ml#L5308
In this line get_refs_start is used but there are no uses of set_refs_start in the same function. Wasm zero initializes local variables, so I'm guessing 0 is a valid value for "refs_start", but since we never update that local, if this local is deliberately not initialized (or updated), we could use a constant instead to be more direct and avoid confusion.
I'm also surprised that we don't get "unused variable" warnings in compile.ml. This could hide a lot of bugs. Was enabling "unused variable" warnings considered before?
I’d just rip out all the reference buffer handling code. We don’t have these kinds of references anywhere on the IC , and I expect by the time we get them (if at all), we’ll have rewritten that code plenty of times.
(Technically, the code is correct: The reference buffer lives at position 0 with size 0. But yeah, this better be cleaned up.)
I’d just rip out all the reference buffer handling code. We don’t have these kinds of references anywhere on the IC
Which code do you mean? I don't understand this code in detail and have no idea which part you mean.
Did you read https://www.joachim-breitner.de/blog/786-A_Candid_explainer__Quirks? The first section is relevant.
Is it really worth ripping this out? We might get them some day.... At least, record the commit that removes support in an issue somewhere... so we can easily recover it.
We can also just leave it as it. But I'd rip it out before investing more into it