tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.72k stars 858 forks source link

transform/rtcalls: Bail fast if can't convert pointer #4290

Closed lpereira closed 3 weeks ago

lpereira commented 3 weeks ago

There's no need to keep looping if one of the uses makes it impossible to convert a call to runtime.stringToBytes() with a raw pointer.

deadprogram commented 3 weeks ago

Thanks for the PR @lpereira

Question: is it correct to say that if any of the uses are invalid, that the string cannot be converted? If so then this looks good to me.

aykevl commented 3 weeks ago

Question: is it correct to say that if any of the uses are invalid, that the string cannot be converted?

Yes.