Last Comment Bug 774464 - JSScript::setSourceMap improperly handles OOM
: JSScript::setSourceMap improperly handles OOM
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla17
Assigned To: general
:
: Jason Orendorff [:jorendorff]
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-16 14:34 PDT by Nick Fitzgerald [:fitzgen] [⏰PDT; UTC-7]
Modified: 2012-07-17 02:12 PDT (History)
2 users (show)
jimb: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (429 bytes, patch)
2012-07-16 14:36 PDT, Nick Fitzgerald [:fitzgen] [⏰PDT; UTC-7]
jimb: review+
Details | Diff | Splinter Review

Description Nick Fitzgerald [:fitzgen] [⏰PDT; UTC-7] 2012-07-16 14:34:02 PDT
When |putNew| fails, it deletes the whole |sourceMapMap| when there could be other entries in there. It should not do this.
Comment 1 Nick Fitzgerald [:fitzgen] [⏰PDT; UTC-7] 2012-07-16 14:36:17 PDT
Created attachment 642731 [details] [diff] [review]
v1
Comment 2 :Benjamin Peterson 2012-07-16 14:45:17 PDT
Comment on attachment 642731 [details] [diff] [review]
v1

Review of attachment 642731 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/jsscript.cpp
@@ -857,3 @@
>      }
>  
>      if (!map->putNew(this, sourceMap)) {

The braces here can be dropped now.
Comment 3 Jim Blandy :jimb 2012-07-16 15:00:59 PDT
Comment on attachment 642731 [details] [diff] [review]
v1

Review of attachment 642731 [details] [diff] [review]:
-----------------------------------------------------------------

This is fine, with the braces dropped as suggested.
Comment 5 Ed Morley [:emorley] 2012-07-17 02:12:06 PDT
https://hg.mozilla.org/mozilla-central/rev/3c3a017a9b04

Note You need to log in before you can comment on or make changes to this bug.