1
1
mirror of https://github.com/tweag/asterius.git synced 2024-10-05 21:30:49 +03:00

Fallback blackholing logic when updateThunk() throws (#581)

This commit is contained in:
Shao Cheng 2020-04-15 13:12:03 +02:00 committed by GitHub
parent ddb3794972
commit 15be80f35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,12 +60,21 @@ export class ExceptionHelper {
const p1 = Number(
this.memory.i64Load(p + rtsConstants.offset_StgUpdateFrame_updatee)
);
this.exports.updateThunk(
this.symbolTable.MainCapability,
tso,
p1,
raise_closure
);
try {
this.exports.updateThunk(
this.symbolTable.MainCapability,
tso,
p1,
raise_closure
);
} catch (err) {
console.error(`updateThunk failed with ${err}`);
this.memory.i64Store(p1, this.symbolTable.stg_BLACKHOLE_info);
this.memory.i64Store(
p1 + rtsConstants.offset_StgInd_indirectee,
raise_closure
);
}
const size = Number(raw_layout & BigInt(0x3f));
p += (1 + size) << 3;
break;