Skip to content

Debug scopes are not handled for loops #2732

Open

Description

@advikkabra

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions