Skip to content

cgen: fix codegen for returning option reference from indexexpr - #23139

Merged
spytheman merged 2 commits into
vlang:masterfrom
felipensp:fix_opt_indexexpr_amp_cgen
Dec 13, 2024
Merged

spytheman merged 2 commits into
vlang:masterfrom
felipensp:fix_opt_indexexpr_amp_cgen

Conversation

@felipensp

@felipensp felipensp commented Dec 11, 2024 •

Copy link
Copy Markdown
Member

Fix #23133 (stack-use-after-return bug)

Hulyยฎ: V_0.6-21576

@felipensp
felipensp marked this pull request as ready for review December 11, 2024 21:15
Comment thread vlib/v/tests/options/option_index_amp_test.v

@spytheman spytheman left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work for the fix.

The test however needs improvements, so that it can actually detect regressions, without manual intervention/inspection, and more details, when it fails, to be more maintainable.

@felipensp

felipensp commented Dec 12, 2024 •

Copy link
Copy Markdown
Member Author

Excellent work for the fix.

The test however needs improvements, so that it can actually detect regressions, without manual intervention/inspection, and more details, when it fails, to be more maintainable.

It will fails consistently running as sanitize tests, because the issue here is a stack-use-after-return issue. The extra prints stuff helps to trigger unexpected results... but I can clean up the code.

@felipensp

Copy link
Copy Markdown
Member Author

Done @spytheman

@spytheman

Copy link
Copy Markdown
Contributor

Done @spytheman

Thank you ๐Ÿ™‡๐Ÿปโ€โ™‚๏ธ .

Comment thread vlib/v/tests/options/option_index_amp_test.v
@spytheman
spytheman merged commit 29f372f into vlang:master Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[option] or block corrupts pointer

2 participants