Bug 31901 - Incorrect behaviour of jneq_null in the interpreter
Summary: Incorrect behaviour of jneq_null in the interpreter
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-25 21:46 PST by Oliver Hunt
Modified: 2009-11-27 13:29 PST (History)
2 users (show)

See Also:


Attachments
Patch (1.39 KB, patch)
2009-11-25 21:48 PST, Oliver Hunt
barraclough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2009-11-25 21:46:21 PST
The interpreters implementation of op_jneq_null is incorrect when the value being compared is set to masquerade as undefined.  The result is that
if (document.all == null) {
    alert("PASS")
} else {
    alert("FAIL")
}
Will fail.
Comment 1 Oliver Hunt 2009-11-25 21:48:05 PST
Created attachment 43894 [details]
Patch
Comment 2 Eric Seidel (no email) 2009-11-25 21:53:56 PST
I'm sure Oliver will chase down the right people, but just in case.
Comment 3 Eric Seidel (no email) 2009-11-25 21:55:12 PST
Comment on attachment 43894 [details]
Patch

I would be happy to r+ this, as it sounds simple. Except w/o test result updates, it's difficult for me to see how it's correct.
Comment 4 Oliver Hunt 2009-11-25 21:58:02 PST
(In reply to comment #3)
> (From update of attachment 43894 [details])
> I would be happy to r+ this, as it sounds simple. Except w/o test result
> updates, it's difficult for me to see how it's correct.

The interpreter currently fails tests due to this -- the issue is that the existing logic will always short circuit on the isUndefinedOrNull for any cell -- eg. the type where we actually have to do the masquerade check.
Comment 5 Eric Seidel (no email) 2009-11-25 22:46:05 PST
Yeah, I think my confusion is just that I was surprised there were no test expectation changes in your patch.  That's all.
Comment 6 Oliver Hunt 2009-11-27 13:29:13 PST
Committed r51424