static __chunk* __new_chunk(hlt_bytes* data, uint64_t rseq, uint64_t len, hlt_exception** excpt, hlt_execution_context* ctx) { __chunk* c = hlt_malloc(sizeof(__chunk)); c->next = 0; c->prev = 0; c->rseq = rseq; c->rupper = rseq + len; GC_ASSIGN(c->data, data, hlt_bytes, ctx); return c; }
void __hlt_set_exception(hlt_exception** dst, hlt_exception_type* type, void* arg, const char* location, hlt_execution_context* ctx) { if ( ! dst ) { fprintf(stderr, "unexpected exception in libhilti (__hlt_set_exception)\n"); abort(); } hlt_exception* e = hlt_exception_new(type, arg, location, ctx); GC_ASSIGN(*dst, e, hlt_exception, ctx); }
void __hlt_context_set_exception(hlt_execution_context* ctx, hlt_exception* excpt) { GC_ASSIGN(ctx->excpt, excpt, hlt_exception, ctx); }