Skip to content

Report error when version script node has local block before the global - #1588

Open
Parth (parth-07) wants to merge 1 commit into
qualcomm:mainfrom
parth-07:VSLocalBeforeGlobalDiag
Open

Parth (parth-07) wants to merge 1 commit into
qualcomm:mainfrom
parth-07:VSLocalBeforeGlobalDiag

Conversation

@parth-07

Copy link
Copy Markdown
Contributor

This commit updates ScriptParser to report error when a version script node contains local block before the global block.

Resolves #1582


It is an error for a ``local:`` block to appear before a ``global:`` block in
the same version node.

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.

can we add a attention syntax here

.. attention::

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.

is there any other kinds of errors that version script parser detects and silently errors out?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

can we add a attention syntax here

The file has now been changed to markdown file. I have added the markdown-alternative :::{note} syntax here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

is there any other kinds of errors that version script parser detects and silently errors out?

If version script node is getting parsed and there has been any other error in the script parsing then the version script node parsing also unnecessarily fails due to the below highlighted code:

VersionScriptBlock *VersionScriptNode::switchToGlobal() {
  if (MLocal && !MGlobal) {
    MHasErrorDuringParsing = true;
    return nullptr;
  }
+  if (MHasErrorDuringParsing)
+    return nullptr;
...

I believe that this should be addresses separately.

This commit updates ScriptParser to report error when a version script
node contains local block before the global block.

Resolves qualcomm#1582

Signed-off-by: Parth Arora <partaror@qti.qualcomm.com>
@parth-07
Parth (parth-07) force-pushed the VSLocalBeforeGlobalDiag branch from 40c53a0 to adad528 Compare October 4, 2026 07:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[version-script] Improve version script diagnostics

3 participants