Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Issue 8363034: Report NullPointerException when we try to construct a regular expression (Closed)

Created:
9 years, 1 month ago by siva
Modified:
9 years, 1 month ago
Reviewers:
turnidge, regis
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Report NullPointerException when we try to construct a regular expression using a NULL pointer. Report NullPointerException instead of ObjectNotClosureException when the closure object is Null. Committed: https://code.google.com/p/dart/source/detail?r=901

Patch Set 1 #

Total comments: 2

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -15 lines) Patch
M lib/regexp.cc View 1 6 chunks +15 lines, -0 lines 0 comments Download
M vm/ast.h View 1 1 chunk +3 lines, -1 line 0 comments Download
M vm/code_generator.cc View 1 2 chunks +8 lines, -1 line 0 comments Download
M vm/parser.cc View 1 4 chunks +39 lines, -13 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
siva
9 years, 1 month ago (2011-10-26 23:43:06 UTC) #1
regis
LGTM
9 years, 1 month ago (2011-10-26 23:55:17 UTC) #2
turnidge
LGTM. One comment below, but it is more for discussion than suggesting that you change ...
9 years, 1 month ago (2011-10-27 17:08:19 UTC) #3
siva
9 years, 1 month ago (2011-10-28 06:14:43 UTC) #4
http://codereview.chromium.org/8363034/diff/1/lib/regexp.cc
File lib/regexp.cc (right):

http://codereview.chromium.org/8363034/diff/1/lib/regexp.cc#newcode86
lib/regexp.cc:86: CheckAndThrowExceptionIfNull(str);
Doing null pointer checks and throwing NullPointerException in dart code seems
weird as it is supposed to happen through a call to noSuchMethod.
I am trying to see if it would be possible to access str in dart code and
trigger a call to noSuchMethod, probably for another CL.

On 2011/10/27 17:08:19, turnidge wrote:
> I just wanted to point out that by putting the check in the C++ code instead
of
> the dart code, we will miss out on the chance to eliminate the null check in
> cases where the compiler knows that str is non-null -- for example, if it has
> just been allocated.  Not sure how much this matters though.

Powered by Google App Engine
This is Rietveld 408576698