Closed Bug 774464 Opened 12 years ago Closed 12 years ago

JSScript::setSourceMap improperly handles OOM

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17

People

(Reporter: fitzgen, Unassigned)

Details

Attachments

(1 file)

When |putNew| fails, it deletes the whole |sourceMapMap| when there could be other entries in there. It should not do this.
Attached patch v1Splinter Review
Attachment #642731 - Flags: review?(jimb)
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 on attachment 642731 [details] [diff] [review]
v1

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

This is fine, with the braces dropped as suggested.
Attachment #642731 - Flags: review?(jimb) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/3c3a017a9b04
Status: NEW → ASSIGNED
Flags: in-testsuite-
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla17
https://hg.mozilla.org/mozilla-central/rev/3c3a017a9b04
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: