[lldb-dev] [Bug 23069] New: 'char' type treated incorrectly in expression evaluation when non default type is used

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 30 04:23:48 PDT 2015


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

            Bug ID: 23069
           Summary: 'char' type treated incorrectly in expression
                    evaluation when non default type is used
           Product: lldb
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at cs.uiuc.edu
          Reporter: tberghammer at google.com
    Classification: Unclassified

When the type of 'char' explicitly specified for the inferior to the opposite
sign then the default on the given architecture (with -fsigned-char or with
-funsigned-char) then the expression evaluation treats 'char' as 'signed char'
or 'unsigned char' what cause incorrect behavior in the following case:

=== main.cpp ===

int foo(char c) { return 1; }
int foo(signed char c) { return 2; }
int foo(unsigned char c) { return 3; }

int main() {
  char c = 0;
  signed char sc = 0;
  unsigned char uc = 0;
  return 0; // Break here
}

=== lldb commands ===

stop at line marked by '// Break here'
expression foo(c)
expression foo(sc)
expression foo(uc)

When incorrect type used for 'char' then (at least) one of the expression
evaluates to incorrect value.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150330/695bcaed/attachment.html>


More information about the lldb-dev mailing list