summaryrefslogtreecommitdiff
path: root/src/wasm-ast-lexer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-ast-lexer.c')
-rw-r--r--src/wasm-ast-lexer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm-ast-lexer.c b/src/wasm-ast-lexer.c
index e743e127..09408b2d 100644
--- a/src/wasm-ast-lexer.c
+++ b/src/wasm-ast-lexer.c
@@ -531,10 +531,11 @@ static WasmResult scan_forward_for_line_offset_in_buffer(
}
}
+ WasmResult result = WASM_OK;
if (p == buffer_end) {
/* end of buffer */
if (find_position == WASM_LINE_OFFSET_POSITION_START) {
- return WASM_ERROR;
+ result = WASM_ERROR;
} else {
line_offset = buffer_file_offset + (buffer_end - buffer_start);
}
@@ -542,7 +543,7 @@ static WasmResult scan_forward_for_line_offset_in_buffer(
*out_line = line;
*out_line_offset = line_offset;
- return WASM_OK;
+ return result;
}
static WasmResult scan_forward_for_line_offset_in_file(