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

Debug scopes are not handled for loops #2732

Open
advikkabra opened this issue Jun 13, 2024 · 0 comments
Open

Debug scopes are not handled for loops #2732

advikkabra opened this issue Jun 13, 2024 · 0 comments

Comments

@advikkabra
Copy link
Collaborator

In the example code here,

i: i32
for i in range(10):
    q: i32 = 10
    j: i32
    for j in range(5):
        p: i32 = i+1

the following error pops up:

code generation error: asr_to_llvm: module failed verification. Error:
conflicting debug info for argument
  call void @llvm.dbg.declare(metadata i32* %p, metadata !10, metadata !DIExpression()), !dbg !17
!7 = !DILocalVariable(name: "j", arg: 1, scope: !3, file: !1, line: 4, type: !8)
!10 = !DILocalVariable(name: "p", arg: 1, scope: !3, file: !1, line: 6, type: !8)

This is due to both j and p being in the same scope when declaring the DILocalVariable, even though they are not in the same scope.

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

No branches or pull requests

1 participant