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+

Description Filip Pizlo 2012-05-30 12:51:49 PDT
Patch forthcoming.
Comment 1 Filip Pizlo 2012-05-30 12:54:03 PDT
Created attachment 144900 [details]
the patch
Comment 2 Geoffrey Garen 2012-05-30 12:56:06 PDT
Comment on attachment 144900 [details]
the patch

r=me
Comment 3 Darin Adler 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?
Comment 4 Filip Pizlo 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.
Comment 5 Geoffrey Garen 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.
Comment 6 Filip Pizlo 2012-05-30 13:36:36 PDT
Landed in http://trac.webkit.org/changeset/118960
Comment 7 Filip Pizlo 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.
Comment 8 Filip Pizlo 2012-05-30 13:59:13 PDT
Created attachment 144918 [details]
a better patch
Comment 9 Filip Pizlo 2012-05-30 14:04:54 PDT
Better fix landed in http://trac.webkit.org/changeset/118966
Comment 10 Filip Pizlo 2012-05-30 16:13:53 PDT
<rdar://problem/11561506>