[ruby-core:64781] [ruby-trunk - Bug #10117] Invalid char does not cause syntax error in eval

From: usa@...
Date: 2014-09-05 04:54:40 UTC
List: ruby-core #64781
Issue #10117 has been updated by Usaku NAKAMURA.

Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONE, 2.1: DONE

backported into `ruby_2_0_0` at r47403.

----------------------------------------
Bug #10117: Invalid char does not cause syntax error in eval
https://bugs.ruby-lang.org/issues/10117#change-48670

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee: Yukihiro Matsumoto
* Category: syntax
* Target version: 
* ruby -v: trunk
* Backport: 2.0.0: DONE, 2.1: DONE
----------------------------------------
Directly coded invalid char causes `SyntaxError`, but not in `eval`.
無効な文字を直接書いたときには`SyntaxError`になりますが、`eval`の中ではなりません。

~~~
$ ruby -e $'\x01'
-e:1: Invalid char `\x01' in expression
bash: exit 1
~~~

~~~
$ ruby -e 'p eval("\x01")'
nil
bash: exit 1
~~~




-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next