Skip to content

SMV: error on duplicate module names#1997

Open
kroening wants to merge 1 commit into
mainfrom
smv-duplicate-module-error
Open

SMV: error on duplicate module names#1997
kroening wants to merge 1 commit into
mainfrom
smv-duplicate-module-error

Conversation

@kroening

@kroening kroening commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Duplicate MODULE declarations with the same name silently overwrote earlier entries in the module map, causing the analyzed module to potentially differ from the source.

This adds an error diagnostic that reports the duplicate at the second occurrence's source location.

Changes:

  • src/smvlang/smv_typecheck.cpp: Check for duplicate module names before building the index
  • regression/smv/modules/duplicate_module1.smv: Test input with MODULE main declared twice
  • regression/smv/modules/duplicate_module1.desc: Expects error with exit code 2

Duplicate MODULE declarations with the same name silently overwrote
earlier entries in the module map, causing the analyzed module to
potentially differ from the source. Add an error diagnostic that
reports the duplicate at the second occurrence's source location.
@kroening kroening added the SMV label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant