diff --git a/src/duk_bi_duktape.c b/src/duk_bi_duktape.c index f154b73e..c62b96c2 100644 --- a/src/duk_bi_duktape.c +++ b/src/duk_bi_duktape.c @@ -146,7 +146,11 @@ DUK_INTERNAL duk_ret_t duk_bi_duktape_object_act(duk_context *ctx) { pc = (duk_uint_fast32_t) act->pc; duk_push_uint(ctx, (duk_uint_t) pc); +#if defined(DUK_USE_PC2LINE) line = duk_hobject_pc2line_query(ctx, -2, pc); +#else + line = 0; +#endif duk_push_uint(ctx, (duk_uint_t) line); /* Providing access to e.g. act->lex_env would be dangerous: these diff --git a/src/duk_js_compiler.c b/src/duk_js_compiler.c index df872eb8..bce83900 100644 --- a/src/duk_js_compiler.c +++ b/src/duk_js_compiler.c @@ -1033,7 +1033,7 @@ DUK_LOCAL void duk__emit(duk_compiler_ctx *comp_ctx, duk_instr_t ins) { #endif /* Limit checks for bytecode byte size and line number. */ -#if defined(DUK_USE_ESBC_LIMITS) +#if defined(DUK_USE_PC2LINE) && defined(DUK_USE_ESBC_LIMITS) if (DUK_UNLIKELY(line > DUK_USE_ESBC_MAX_LINENUMBER || DUK_HBUFFER_GET_SIZE((duk_hbuffer *) h) > DUK_USE_ESBC_MAX_BYTES)) { DUK_ERROR(comp_ctx->thr, DUK_ERR_RANGE_ERROR, DUK_STR_BYTECODE_LIMIT);