-
-
Notifications
You must be signed in to change notification settings - Fork 675
fix: avoid to visit nullptr in binaryen #2943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Module.getExpressionId will be used for nullptr ExpressionRef. It works because deref nullptr in binaryen's wasm is valid. Adding guard can enhance robustness
If we replace guard with assert, the compiler will crash during testing.
|
some background: I am trying to revert the relationship between AS and binaryen. it will create a new c++ program integrated binaryen in native as static lib and WASM runtime. Then it will load AS bootstrapped WASM to compile source code. |
Regarding that compiler crash, maybe we should find out where a null pointer is being passed, and see if that's intended? If it is intended, this change makes more sense. Regarding your testing with the AS compiler embedded within a C++ executable...I don't think you can upstream that, but it might be interesting to open-source if possible. It would definitely be cool to see how necessary the JS glue in binaryen.js is to AssemblyScript. |
open source is in progress. it should be finished in this year
It generated by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Looks like everyone else in compiler.ts
/flow.ts
does the same thing too!
Module.getExpressionId will be used for nullptr ExpressionRef. It works because deref nullptr in binaryen's wasm is valid.
check BinaryenExprRef non-null before.