start lambda source info at bytecode pos -1

This commit is contained in:
Alex Shinn 2021-04-08 22:59:18 +09:00
parent d69ffce3f2
commit e3078a7c4c
2 changed files with 6 additions and 0 deletions

View file

@ -36,6 +36,7 @@ CPPFLAGS=-DSEXP_USE_MUTABLE_STRINGS=0
CPPFLAGS=-DSEXP_USE_STRING_INDEX_TABLE=1 CPPFLAGS=-DSEXP_USE_STRING_INDEX_TABLE=1
CPPFLAGS=-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 CPPFLAGS=-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1
CPPFLAGS=-DSEXP_USE_FIXED_CHUNK_SIZE_HEAPS=1 CPPFLAGS=-DSEXP_USE_FIXED_CHUNK_SIZE_HEAPS=1
CPPFLAGS=-DSEXP_USE_FULL_SOURCE_INFO=0
CPPFLAGS=-DSEXP_USE_NO_FEATURES=1 CPPFLAGS=-DSEXP_USE_NO_FEATURES=1
CFLAGS=-std=c89 CFLAGS=-std=c89
CFLAGS=-m32;LDFLAGS=-m32 CFLAGS=-m32;LDFLAGS=-m32

5
vm.c
View file

@ -678,7 +678,12 @@ static void generate_lambda (sexp ctx, sexp name, sexp loc, sexp lam, sexp lambd
sexp_context_exception(ctx) = bc; sexp_context_exception(ctx) = bc;
} else { } else {
sexp_bytecode_name(bc) = sexp_lambda_name(lambda); sexp_bytecode_name(bc) = sexp_lambda_name(lambda);
#if SEXP_USE_FULL_SOURCE_INFO
sexp_bytecode_source(bc) = sexp_cons(ctx, SEXP_NEG_ONE, sexp_lambda_source(lambda));
sexp_bytecode_source(bc) = sexp_cons(ctx, sexp_bytecode_source(bc), SEXP_NULL);
#else
sexp_bytecode_source(bc) = sexp_lambda_source(lambda); sexp_bytecode_source(bc) = sexp_lambda_source(lambda);
#endif
if (sexp_nullp(fv)) { if (sexp_nullp(fv)) {
/* shortcut, no free vars */ /* shortcut, no free vars */
tmp = sexp_make_vector(ctx2, SEXP_ZERO, SEXP_VOID); tmp = sexp_make_vector(ctx2, SEXP_ZERO, SEXP_VOID);