Project

General

Profile

Actions

Bug #4379

closed

[patch] eval(s, b, "(eval)", n) discards location

Added by quix (James M. Lawrence) over 11 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Target version:
ruby -v:
ruby 1.9.3dev (2011-02-08 trunk 30820) [i386-darwin9.8.0]
[ruby-core:35139]

Description

=begin
% ruby -e 'p eval("raise", nil, "(eval)", 999)'
-e:1:in eval': (eval):999:in ': (RuntimeError)
from -e:1:in eval' from -e:1:in '

With binding, location is ignored.

% ruby -e 'p eval("raise", binding, "(eval)", 999)'
-e:1:in <main>': unhandled exception from -e:1:in eval'
from -e:1:in `'

source_location has a similar problem.

The patch also applies cleanly to 1.9.2.
=end


Files

test_eval_location.patch (762 Bytes) test_eval_location.patch quix (James M. Lawrence), 02/08/2011 03:19 AM
eval_location.patch (1.26 KB) eval_location.patch quix (James M. Lawrence), 02/08/2011 03:19 AM
better_eval_location.patch (1.27 KB) better_eval_location.patch Slightly nicer version of eval_location.patch quix (James M. Lawrence), 02/08/2011 05:23 AM
final_eval_location.patch (4.11 KB) final_eval_location.patch This passes rubyspec while the above does not. Ensures __FILE__ == eval("__FILE__", binding) quix (James M. Lawrence), 02/09/2011 06:57 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)Closedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF