diff options
| author | dearblue <[email protected]> | 2021-12-17 23:03:27 +0900 |
|---|---|---|
| committer | dearblue <[email protected]> | 2021-12-17 23:03:27 +0900 |
| commit | 26338fe640720a39303885a98e6312210f051cde (patch) | |
| tree | 7a39c0bf206265426413ca7b722521c03d7b8928 /src/init.c | |
| parent | 9b65d0dc861f4a5d1605fa7fccb56f1758a2bd6f (diff) | |
| download | mruby-26338fe640720a39303885a98e6312210f051cde.tar.gz mruby-26338fe640720a39303885a98e6312210f051cde.zip | |
Print error before cleanup in `codegen_error()`
Previously, it always pointed to the highest scope as the location of the error.
- example code `code.rb`
```ruby
huge_num = "1" + "0" * 300; eval <<CODE, nil, "test.rb", 1
class Object
module A
#{huge_num}
end
end
CODE
```
- Before this patch
```console
% bin/mruby code.rb
test.rb:1: integer too big
trace (most recent call last):
[1] code.rb:1
code.rb:1:in eval: codegen error (ScriptError)
```
- After this patch
```console
% bin/mruby code.rb
test.rb:3: integer too big
trace (most recent call last):
[1] code.rb:1
code.rb:1:in eval: codegen error (ScriptError)
```
Diffstat (limited to 'src/init.c')
0 files changed, 0 insertions, 0 deletions
