mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 854448 - Fix debug-only null-deref in JSFunction::name (r=njn)
--HG-- extra : rebase_source : 421a3c31a108e13cd0d2cbba5bd93afeb0432586
This commit is contained in:
parent
097b6f1c77
commit
19eb172321
@ -99,3 +99,35 @@ function assertTypeFailInEval(str)
|
||||
assertTypeFailInEval('function f({}) { "use asm"; function g() {} return g }');
|
||||
assertTypeFailInEval('function f({global}) { "use asm"; function g() {} return g }');
|
||||
assertTypeFailInEval('function f(global, {imports}) { "use asm"; function g() {} return g }');
|
||||
|
||||
function assertLinkFailInEval(str)
|
||||
{
|
||||
if (!isAsmJSCompilationAvailable())
|
||||
return;
|
||||
|
||||
var caught = false;
|
||||
var oldOpts = options("werror");
|
||||
assertEq(oldOpts.indexOf("werror"), -1);
|
||||
try {
|
||||
eval(str);
|
||||
} catch (e) {
|
||||
assertEq((''+e).indexOf(ASM_OK_STRING) == -1, false);
|
||||
caught = true;
|
||||
}
|
||||
assertEq(caught, true);
|
||||
options("werror");
|
||||
|
||||
var code = eval(str);
|
||||
|
||||
var caught = false;
|
||||
var oldOpts = options("werror");
|
||||
assertEq(oldOpts.indexOf("werror"), -1);
|
||||
try {
|
||||
code.apply(null, Array.slice(arguments, 1));
|
||||
} catch (e) {
|
||||
caught = true;
|
||||
}
|
||||
assertEq(caught, true);
|
||||
options("werror");
|
||||
}
|
||||
assertLinkFailInEval('(function(global) { "use asm"; var im=global.Math.imul; function g() {} return g })');
|
||||
|
@ -165,7 +165,7 @@ class JSFunction : public JSObject
|
||||
}
|
||||
|
||||
JSAtom *atom() const { return hasGuessedAtom() ? NULL : atom_.get(); }
|
||||
js::PropertyName *name() const { return hasGuessedAtom() ? NULL : atom_->asPropertyName(); }
|
||||
js::PropertyName *name() const { return hasGuessedAtom() || !atom_ ? NULL : atom_->asPropertyName(); }
|
||||
inline void initAtom(JSAtom *atom);
|
||||
JSAtom *displayAtom() const { return atom_; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user