-
Notifications
You must be signed in to change notification settings - Fork 51
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
A crash bug due to recursiveCopy? #141
Closed
Labels
crash
the compiler crashes
Comments
zyz9740
changed the title
A crash bug due to llvm::Value::setNameImpl
A crash bug due to recursiveCopy?
Jan 6, 2023
Hyxogen
added a commit
to leaningtech/cheerp-compiler
that referenced
this issue
Feb 6, 2024
LLVM is smart enough to be able to remove a gep if the source and indexes are constants. However, it was assumed that it would always emit a gep instruction, which would cause a crash when trying to cast it. Upon further inspection, I believe that this casting to a GEPOperator and then getting the result element type is overkill, and we could just simply use the type of the value. This fixes: leaningtech/cheerp-meta#141
Hyxogen
added a commit
to leaningtech/cheerp-compiler
that referenced
this issue
Feb 6, 2024
LLVM is smart enough to be able to remove a gep if the source and indexes are constants. However, it was assumed that it would always emit a gep instruction, which would cause a crash when trying to cast it. Upon further inspection, I believe that this casting to a GEPOperator and then getting the result element type is overkill, and we could just simply use the type of the value. This fixes: leaningtech/cheerp-meta#141
Hyxogen
added a commit
to leaningtech/cheerp-compiler
that referenced
this issue
Feb 6, 2024
LLVM is smart enough to be able to fold a gep if the source and indices are constants. However, it was assumed that it would always emit a gep instruction, which would cause a crash when trying to cast it. Upon further inspection, I believe that the surrounding if statement was meant as a way of working around one of such folds. The new code should work for the general case, so I've removed it. This fixes: leaningtech/cheerp-meta#141
yuri91
pushed a commit
to leaningtech/cheerp-compiler
that referenced
this issue
Feb 6, 2024
LLVM is smart enough to be able to fold a gep if the source and indices are constants. However, it was assumed that it would always emit a gep instruction, which would cause a crash when trying to cast it. Upon further inspection, I believe that the surrounding if statement was meant as a way of working around one of such folds. The new code should work for the general case, so I've removed it. This fixes: leaningtech/cheerp-meta#141
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source:
Reproduce:
/opt/cheerp/bin/clang -target cheerp-wasm random.c -o random_cheerp.js
Log:
Version:
The text was updated successfully, but these errors were encountered: