Bug 87887

Summary: ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
Product: WebKit Reporter: Filip Pizlo <fpizlo>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
the patch
ggaren: review+
a better patch darin: review+

Filip Pizlo
Reported 2012-05-30 12:51:49 PDT
Patch forthcoming.
Attachments
the patch (1.40 KB, patch)
2012-05-30 12:54 PDT, Filip Pizlo
ggaren: review+
a better patch (4.08 KB, patch)
2012-05-30 13:59 PDT, Filip Pizlo
darin: review+
Filip Pizlo
Comment 1 2012-05-30 12:54:03 PDT
Created attachment 144900 [details] the patch
Geoffrey Garen
Comment 2 2012-05-30 12:56:06 PDT
Comment on attachment 144900 [details] the patch r=me
Darin Adler
Comment 3 2012-05-30 13:01:22 PDT
Comment on attachment 144900 [details] the patch Do we actually call SourceProvider::asID on a null pointer? Why?
Filip Pizlo
Comment 4 2012-05-30 13:17:26 PDT
(In reply to comment #3) > (From update of attachment 144900 [details]) > Do we actually call SourceProvider::asID on a null pointer? Why? Null SourceProvider means something like "I have an unnamed source provider". There are a few places in the code where we explicitly check for null SourceProviders, but the asID() method is called without such checks, and generally works OK except when it returns zero and that zero ends up in some HashMap in the bindings.
Geoffrey Garen
Comment 5 2012-05-30 13:24:33 PDT
On second thought, how do we ever end up with a NULL source provider? I would expect some operations, like toString, which don't check for NULL, to crash in that case. It seems like NULL might be a bug.
Filip Pizlo
Comment 6 2012-05-30 13:36:36 PDT
Filip Pizlo
Comment 7 2012-05-30 13:43:39 PDT
Reopening because it would be better to check for null SourceProvider at the call site, rather than inside the function.
Filip Pizlo
Comment 8 2012-05-30 13:59:13 PDT
Created attachment 144918 [details] a better patch
Filip Pizlo
Comment 9 2012-05-30 14:04:54 PDT
Filip Pizlo
Comment 10 2012-05-30 16:13:53 PDT
Note You need to log in before you can comment on or make changes to this bug.