Page MenuHomePhabricator

Use uint64_t for GoArray size.

Authored by brucem on Sep 14 2015, 8:21 PM.



This was int64_t, but all usages of it came from code that was passing
in unsigned values. The usages of the array size, except for one, were
also treating it as an unsigned value. The usage that treated it as
signed was to try to figure out if it was a complete type or not, but
the callers creating the array didn't seem to be aware of using -1 as
an indicator for an incomplete array.

Diff Detail


Event Timeline

brucem updated this revision to Diff 34775.Sep 14 2015, 8:21 PM
brucem retitled this revision from to Use uint64_t for GoArray size..
brucem updated this object.
brucem added reviewers: ribrdb, clayborg.
brucem added a subscriber: lldb-commits.

This is meant to fix this warning:

llvm/tools/lldb/source/Symbol/GoASTContext.cpp:1107:40: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int64_t' (aka 'long long') [-Wsign-compare]
        if (ignore_array_bounds || idx < a->GetLength())
                                   ~~~ ^ ~~~~~~~~~~~~~~
1 warning generated.
ribrdb accepted this revision.Sep 14 2015, 8:59 PM
ribrdb edited edge metadata.

Looks good

This revision is now accepted and ready to land.Sep 14 2015, 8:59 PM
This revision was automatically updated to reflect the committed changes.