JSScript::setSourceMap improperly handles OOM

RESOLVED FIXED in mozilla17

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: fitzgen, Unassigned)

Tracking

unspecified
mozilla17
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

When |putNew| fails, it deletes the whole |sourceMapMap| when there could be other entries in there. It should not do this.
Created attachment 642731 [details] [diff] [review]
v1
Attachment #642731 - Flags: review?(jimb)

Comment 2

5 years ago
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

5 years ago
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+

Comment 4

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.