Skip to content

fix(ir/validator): validate non-struct type in Access/ExtractStructField + fix retintroduce typo#105

Open
Dhakshin2007 wants to merge 1 commit intogoogle:mainfrom
Dhakshin2007:patch-2
Open

fix(ir/validator): validate non-struct type in Access/ExtractStructField + fix retintroduce typo#105
Dhakshin2007 wants to merge 1 commit intogoogle:mainfrom
Dhakshin2007:patch-2

Conversation

@Dhakshin2007
Copy link
Copy Markdown

Two fixes in validator.rs:

  1. BUG FIX (logic): validate_struct_field_in_bounds() silently ignored
    Access/ExtractStructField opcodes when the resolved type was not a
    struct. This means corrupted IR (e.g., using AccessStructField on an
    array or vector type) would pass validation without any error.
    Added an else if branch so that applying these opcodes to a non-struct
    type is now correctly caught and reported as an IR error.

  2. fix typo: retintroduce -> reintroduce in TODO comment (line 42)

…eld + fix typo

Two fixes in validator.rs:

1. BUG FIX (logic): validate_struct_field_in_bounds() silently ignored
   Access/ExtractStructField opcodes when the resolved type was not a
   struct. Added an else-if branch so that using these opcodes on a
   non-struct type is now correctly reported as an IR error.

2. fix typo: 'retintroduce' -> 'reintroduce' in TODO comment
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.

1 participant