summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-07-29 12:25:54 +0200
committerJo-Philipp Wich <jo@mein.io>2022-07-30 00:41:56 +0200
commitafd78c1f30ce5d32d0a8dbce72e76d7871903f2f (patch)
tree01593400061a70383be36b45736f2b4e4ba0ea0f
parente1c3db05168d0417b3ac5465517c7e6957b28bb5 (diff)
compiler: fix reported source position in inc/dec operator error
Report the proper source location when raising an error due to an increment/decrement operation on a constant value. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--compiler.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler.c b/compiler.c
index d03ce5e..26377d8 100644
--- a/compiler.c
+++ b/compiler.c
@@ -871,7 +871,7 @@ uc_compiler_emit_inc_dec(uc_compiler_t *compiler, uc_tokentype_t toktype, bool i
varname = compiler->upvals.entries[cidx].name;
if (varname)
- uc_compiler_syntax_error(compiler, 0,
+ uc_compiler_syntax_error(compiler, compiler->parser->prev.pos,
"Invalid increment/decrement of constant '%s'",
ucv_string_get(varname));