b9org / b9

An educational JS virtual machine based on Eclipse OMR
http://www.base9.xyz
Apache License 2.0
45 stars 24 forks source link

Fix crash when function body is empty #96

Closed xliang6 closed 7 years ago

xliang6 commented 7 years ago
  1. Currently JIT compiler assumes a non-empty function body, and when it encounters an empty function, it crashes. Fix is to check the method's number of bytecodes and abort compile when there is 0 bytecodes.
  2. In file test/interpreter_test.src, add CASCON2017 eye-catcher in b9main.

Signed-off-by: Xiaoli Liang xliang6@gmail.com

xliang6 commented 7 years ago

This fixes issue #95.

xliang6 commented 7 years ago

@rwy0717 @youngar Please review and merge. Thanks.

rwy7 commented 7 years ago

Looks good, but I think the eyecatcher in interpreter_test.src is the wrong place. If we get people to add the mul/div tests to the list in b9test.cpp, the test will run under 4 configurations (interp, jit, jit/DC, jit/PP, and jit/LVMS). Plus, that's how all the other interpreter_test functions are run.