Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression #20777: wrong line numbers diagnosed in inline asm #20982

Open
ibuclaw opened this issue Mar 13, 2025 · 3 comments
Open

Regression #20777: wrong line numbers diagnosed in inline asm #20982

ibuclaw opened this issue Mar 13, 2025 · 3 comments
Labels
Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions

Comments

@ibuclaw
Copy link
Member

ibuclaw commented Mar 13, 2025

Example:

module asm1;



// Gap intentional



void main()
{
    asm { "" [; }
}

Reports:

asm1.d(1): Error: expression expected, not `;`
module asm1;
^
asm1.d(1): Error: found `End of File` when expecting `,`
module asm1;
 ^
asm1.d(1): Error: found `End of File` when expecting `]`
module asm1;
 ^
asm1.d(1): Error: found `End of File` when expecting `;`
module asm1;
 ^

Introduced by #20777

@ibuclaw ibuclaw added Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions labels Mar 13, 2025
@dkorpel
Copy link
Contributor

dkorpel commented Mar 13, 2025

Do you have a test case for dmd?

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 13, 2025

Do you have a test case for dmd?

Not without adding a call to gccAsmSemantic in dmd's branch for asm semantic.

Looking at the change, I suspect it might be a new requirement to fix up the starting line?

https://github.com/dlang/dmd/pull/20777/files#diff-862192b33df815981dcb4a8a49bc7dc572506b444a7dc034fde3643f887e2982R5931

@dkorpel
Copy link
Contributor

dkorpel commented Mar 13, 2025

Yes, gccAsmSemantic does p.scanloc = s.loc; which doesn't work anymore. I'll see if I can unittest that function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compiler:GDC Gnu D Compiler Severity:Regression PRs that fix regressions
Projects
None yet
Development

No branches or pull requests

2 participants