Project

General

Profile

Actions

Bug #4379

closed

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

Added by quix (James M. Lawrence) almost 14 years ago. Updated almost 8 years ago.

Status:
Closed
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 #3

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Assigned
  • Assignee set to matz (Yukihiro Matsumoto)

Matz, how do you think, 1.8's result is:

% ruby -ve 'p eval("raise", binding, "(eval)", 999)'
ruby 1.8.7 (2010-08-16 patchlevel 302) [amd64-freebsd8]
-e:1:in `eval': (eval):999: (RuntimeError)
from -e:1

Updated by ko1 (Koichi Sasada) over 12 years ago

  • Assignee changed from matz (Yukihiro Matsumoto) to ko1 (Koichi Sasada)

Updated by ko1 (Koichi Sasada) about 12 years ago

  • Target version changed from 2.0.0 to 2.6

Are there any applications that this problem is critical for?

Updated by ko1 (Koichi Sasada) almost 8 years ago

  • Status changed from Assigned to Closed

No feedback.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0