Skip to content

Commit

Permalink
Merge branch 'fix-no-pc2line-opt'
Browse files Browse the repository at this point in the history
See GH-59.
  • Loading branch information
svaarala committed Oct 29, 2014
2 parents baac781 + c4250e9 commit b0a553a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions RELEASES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,16 @@ Released
Planned
=======

1.0.1 (2014-XX-XX)
------------------

* Fix compile error for DUK_OPT_NO_PC2LINE

1.1.0 (2014-XX-XX)
------------------

* Fix compile error for DUK_OPT_NO_PC2LINE

1.2.0 (2015-XX-XX)
------------------

Expand Down
4 changes: 4 additions & 0 deletions src/duk_bi_duktape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/duk_js_compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 4 additions & 2 deletions util/matrix_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@

featureopts = [
'',
'-DDUK_OPT_NO_PACKED_TVAL -DDUK_OPT_SELF_TESTS -DDUK_OPT_NO_MARK_AND_SWEEP'
'-DDUK_OPT_NO_PACKED_TVAL -DDUK_OPT_SELF_TESTS -DDUK_OPT_NO_MARK_AND_SWEEP',
'-DDUK_OPT_NO_PC2LINE'
# XXX: more feature combinations
]

gccoptimizeopts = [
Expand Down Expand Up @@ -84,7 +86,7 @@ def check_unlink(filename):

def main():
opts = gencommands([gccstdopts, gccdebugopts, gccwarnopts, gccoptimizeopts,
debugopts, assertopts])
debugopts, assertopts, featureopts])

f = open('/tmp/test.js', 'wb')
f.write('''\
Expand Down

0 comments on commit b0a553a

Please sign in to comment.