https://bugs.llvm.org/show_bug.cgi?id=30553

Paul Robinson <paul_robin...@playstation.sony.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #3 from Paul Robinson <paul_robin...@playstation.sony.com> ---
Reopened on behalf of Carlos Enciso, who made this comment on Phabricator
post-commit:

Hi @sdesmalen!

First of all my apologies for commenting after the issue has been closed, but I
do not have an account to add a comment to the associated bugzilla.

I have found what it seems to be an issue with the current implementation.

For the given test case

  int main() {
    int size = 2;

    int vla_expr[size];
    vla_expr[1] = 1;

    return 0;
  }

and while debugging with LLDB, the following error is generated:

  (lldb) n
  Process 21014 stopped
  * thread #1, name = 'bad.out', stop reason = step over
      frame #0: 0x0000000000400502 bad.out`main at vla_2.cpp:7
     4            int vla_expr[size];
     5            vla_expr[1] = 1;
     6          
  -> 7            return 0;
     8          }

  (lldb) p vla_expr
  (unsigned long) $0 = 2

  (lldb) p vla_expr[1]
  error: subscripted value is not an array, pointer, or vector

  (lldb) 

Looking at the DWARF generated, there are 2 variables with the same name at the
same scope

  DW_TAG_subprogram "main"
    ...
    DW_TAG_variable "size"
    DW_TAG_variable "vla_expr"
    DW_TAG_variable "vla_expr"

I think there are 2 issues:

The compiler generated variable 'vla_expr'

- should be flagged as artificial (DW_AT_artificial)
- its name should start with double underscore to avoid conflicting with
user-defined names.

Thanks,
Carlos

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to