Skip to content

fix(parser): avoid panic after asm lock prefix - #28009

Open
ShiroKSH wants to merge 1 commit into
vlang:masterfrom
ShiroKSH:fix/asm-lock-eof-crash
Open

fix(parser): avoid panic after asm lock prefix#28009
ShiroKSH wants to merge 1 commit into
vlang:masterfrom
ShiroKSH:fix/asm-lock-eof-crash

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Aug 1, 2026

Copy link
Copy Markdown

Summary

  • prevent the parser from indexing an empty token after an x86 lock prefix
  • add a parser-error regression fixture for a truncated inline-assembly block

Root cause

After parsing lock, the parser advances to EOF for truncated input and indexed the empty token literal to check an instruction suffix. This crashed the compiler instead of reporting a syntax error.

Validation

  • ./vnew -silent vlib/v/compiler_errors_test.v
  • ./vnew -silent test vlib/v/parser/
  • ./vnew -silent test vlib/encoding/base58/
  • ./vnew -silent test vlib/encoding/binary/

@medvednikov

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 99f5011f9d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

2 participants