kill actor when abusive

This commit is contained in:
2026-02-17 17:34:25 -06:00
parent 2df45b2acb
commit 5ee51198a7
11 changed files with 396 additions and 110 deletions

View File

@@ -1138,6 +1138,13 @@ struct JSContext {
JSValue reg_current_frame; /* current JSFrameRegister being executed */
uint32_t current_register_pc; /* PC at exception time */
/* VM suspend/resume state */
int suspended; /* 1 = VM was suspended (not exception) */
JSGCRef suspended_frame_ref; /* GC-rooted saved frame for resume */
uint32_t suspended_pc; /* saved PC for resume */
int vm_call_depth; /* 0 = pure bytecode, >0 = C frames on stack */
size_t heap_memory_limit; /* 0 = no limit, else max heap bytes */
JSInterruptHandler *interrupt_handler;
void *interrupt_opaque;
@@ -1540,7 +1547,8 @@ void JS_ThrowInterrupted (JSContext *ctx);
static no_inline __exception int __js_poll_interrupts (JSContext *ctx) {
ctx->interrupt_counter = JS_INTERRUPT_COUNTER_INIT;
if (ctx->interrupt_handler) {
if (ctx->interrupt_handler (ctx->rt, ctx->interrupt_opaque)) {
int r = ctx->interrupt_handler (ctx->rt, ctx->interrupt_opaque);
if (r < 0) {
JS_ThrowInterrupted (ctx);
return -1;
}