mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
1337444 - wasm: runtime crash involving i64 globals
1337444: Fix regalloc of load/store i64 globals;
This commit is contained in:
parent
76d0a10fee
commit
82b486fe9b
1 changed files with 23 additions and 8 deletions
|
|
@ -4244,22 +4244,37 @@ LIRGenerator::visitWasmBoundsCheck(MWasmBoundsCheck* ins)
|
|||
void
|
||||
LIRGenerator::visitWasmLoadGlobalVar(MWasmLoadGlobalVar* ins)
|
||||
{
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
if (ins->type() == MIRType::Int64)
|
||||
if (ins->type() == MIRType::Int64) {
|
||||
#ifdef JS_PUNBOX64
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
#else
|
||||
LAllocation tlsPtr = useRegister(ins->tlsPtr());
|
||||
#endif
|
||||
defineInt64(new(alloc()) LWasmLoadGlobalVarI64(tlsPtr), ins);
|
||||
else
|
||||
} else {
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
define(new(alloc()) LWasmLoadGlobalVar(tlsPtr), ins);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LIRGenerator::visitWasmStoreGlobalVar(MWasmStoreGlobalVar* ins)
|
||||
{
|
||||
MDefinition* value = ins->value();
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
if (value->type() == MIRType::Int64)
|
||||
add(new(alloc()) LWasmStoreGlobalVarI64(useInt64RegisterAtStart(value), tlsPtr), ins);
|
||||
else
|
||||
add(new(alloc()) LWasmStoreGlobalVar(useRegisterAtStart(value), tlsPtr), ins);
|
||||
if (value->type() == MIRType::Int64) {
|
||||
#ifdef JS_PUNBOX64
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
LInt64Allocation valueAlloc = useInt64RegisterAtStart(value);
|
||||
#else
|
||||
LAllocation tlsPtr = useRegister(ins->tlsPtr());
|
||||
LInt64Allocation valueAlloc = useInt64Register(value);
|
||||
#endif
|
||||
add(new(alloc()) LWasmStoreGlobalVarI64(valueAlloc, tlsPtr), ins);
|
||||
} else {
|
||||
LAllocation tlsPtr = useRegisterAtStart(ins->tlsPtr());
|
||||
LAllocation valueAlloc = useRegisterAtStart(value);
|
||||
add(new(alloc()) LWasmStoreGlobalVar(valueAlloc, tlsPtr), ins);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue