Repository navigation
fix inline directive passing on unrelated compiler output - #26
Open
siyul-park wants to merge 1 commit into
Open
siyul-park wants to merge 1 commit into
siyul-park wants to merge 1 commit into
Conversation
A callsite of a //gcassert:inline function was treated as inlined when any compiler output was reported at the call's position. Escape analysis reports at the same position, so a call that was not inlined could pass, for example when its result escapes to the heap. Only accept an "inlining call to" message at the callsite, as the directive-on-the-line path already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A callsite of a
//gcassert:inlinefunction is marked as passed when any-moutput is reported at the call's line and column. The message is not checked. Escape analysis also reports at the call's opening parenthesis, so a call that was never inlined still passes:Before this change, gcassert reported no failure for this code.
The fix accepts a callsite only on an
inlining call tomessage. The directive-on-the-line path already does this check.Test plan
testdata/inline_escape.goas a regression test. It fails before the fix and passes after.go test -race ./...passes.🤖 Generated with Claude Code