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

Issue 6588130: Handled return-value of SetElement in some cases, or avoided it in other. (Closed)

Created:
9 years, 9 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev, Rico
Visibility:
Public.

Description

Handled return-value of SetElement in some cases, or avoided it in other. SetElement can cause an exception to be thrown. If its return value isn't checked, this exception might not be handled at the correct time. In some cases, it's a matter of returning Exception::Failure() from a runtime function. In other cases, code using SetElement on a JSArray has been changed to setting directly on a FixedArray and only creating the JSArray at the end. Committed: http://code.google.com/p/v8/source/detail?r=7039

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixed one more case in parser.cc #

Patch Set 3 : Addressed review comments. Fixed some GetElements. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -49 lines) Patch
M src/jsregexp.cc View 2 chunks +10 lines, -8 lines 0 comments Download
M src/objects.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/objects.cc View 1 chunk +0 lines, -7 lines 0 comments Download
M src/parser.cc View 1 3 chunks +15 lines, -10 lines 0 comments Download
M src/runtime.cc View 1 2 14 chunks +47 lines, -24 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Lasse Reichstein
9 years, 9 months ago (2011-03-02 20:21:56 UTC) #1
antonm
Drive-by comments http://codereview.chromium.org/6588130/diff/1/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/6588130/diff/1/src/runtime.cc#newcode1473 src/runtime.cc:1473: if (result.is_null()) return Failure::Exception(); you may use ...
9 years, 9 months ago (2011-03-02 20:28:47 UTC) #2
Søren Thygesen Gjesse
LGTM In objects.h SetElement if declared with MUST_USE_RESULT, which for GCC 4.x is "__attribute__ ((warn_unused_result))". ...
9 years, 9 months ago (2011-03-03 07:47:04 UTC) #3
Søren Thygesen Gjesse
LGTM for the GetElements as well.
9 years, 9 months ago (2011-03-03 10:14:22 UTC) #4
Lasse Reichstein
9 years, 9 months ago (2011-03-03 10:16:01 UTC) #5
Thanks.
We should make SetElement MUST_USE_RESULT as soon as we have handled it
everywhere.

Powered by Google App Engine
This is Rietveld 408576698