Skip to content

Commit f6ddb9c

Browse files
committed
prism_compile.c: Fix -Wmaybe-uninitialized warning in pm_compile_call
Initialize `end_cursor` to 0. It is guarded by `end_found` but the compiler cannot prove `end_found` is always true when `end_cursor` is read.
1 parent 1389a36 commit f6ddb9c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

prism_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3749,7 +3749,7 @@ pm_compile_call(rb_iseq_t *iseq, const pm_call_node_t *call_node, LINK_ANCHOR *c
37493749

37503750
if (PM_NODE_FLAG_P(call_node, PM_CALL_NODE_FLAGS_SAFE_NAVIGATION)) {
37513751
if (PM_BRANCH_COVERAGE_P(iseq)) {
3752-
uint32_t end_cursor;
3752+
uint32_t end_cursor = 0;
37533753
bool end_found = false;
37543754

37553755
if (call_node->closing_loc.length > 0) {

0 commit comments

Comments
 (0)