mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 485889 - Incorrect null checking/assignment? (with xpcshell test case). r=gal
This commit is contained in:
parent
877ebdcc1f
commit
f156a254b7
@ -5043,8 +5043,10 @@ TraceRecorder::ifop()
|
||||
bool cond;
|
||||
LIns* x;
|
||||
|
||||
/* Objects always evaluate to true since we specialize the Null type on trace. */
|
||||
if (JSVAL_TAG(v) == JSVAL_OBJECT) {
|
||||
if (JSVAL_IS_NULL(v)) {
|
||||
cond = false;
|
||||
x = lir->insImm(0);
|
||||
} else if (!JSVAL_IS_PRIMITIVE(v)) {
|
||||
cond = true;
|
||||
x = lir->insImm(1);
|
||||
} else if (JSVAL_TAG(v) == JSVAL_BOOLEAN) {
|
||||
|
@ -4740,6 +4740,26 @@ testNewString.jitstats = {
|
||||
};
|
||||
test(testNewString);
|
||||
|
||||
function testWhileObjectOrNull()
|
||||
{
|
||||
try
|
||||
{
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
var o = { p: { p: null } };
|
||||
while (o.p)
|
||||
o = o.p;
|
||||
}
|
||||
return "pass";
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
return "threw exception: " + e;
|
||||
}
|
||||
}
|
||||
testWhileObjectOrNull.expected = "pass";
|
||||
test(testWhileObjectOrNull);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* *
|
||||
|
Loading…
Reference in New Issue
Block a user