-
Notifications
You must be signed in to change notification settings - Fork 628
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
Ignorance of exception "integer divide by zero" in llvm-jit mode #2650
Comments
Because of the |
Thank you for the explanation! Please let me know when and how you fix it. |
Hi, I checked the issue again, it seems that it is caused by the i32.rotl opcode but not the i32.div_s opcode. It runs OK after applying patch #2697. For opcode i32.div_s, the AOT compiler adds checks and generates call IR to call aot_set_exception_with_id function, normally it should not be eliminated as dead code. For example, for the wasm function below: (func (export "test") (param i32)
(i32.const 1234)
(local.get 0)
i32.div_s
drop
) The drop is added after i32.div_s, but after running |
Yes, I tried it with patch #2697 and it can throw exception correctly. Thank you for the explanation about |
Test Case
report7.zip
Result
If I run this code on
llvm-jit
mode, it will exit normally. But infast-jit
mode orinterp
mode, it will threw aninteger divide by zero
exception.By the way, I tried the same code with other runtimes. They all throw
integer divide by zero
exception.Extra Information
If I change
i32.div_s
(in line 79) intoi32.add
, all runtimes will exit normally.Maybe it is a problem of
i32.rotl
instruction because its result is different betweenllvm-jit
mode andfast-jit
mode.Versions and Environment
wamr version : 1.2.3
Operating system: Ubuntu 20.04
Architecture: x86_64
The text was updated successfully, but these errors were encountered: