OSDN Git Service

Fix RegType invariant checks.
authorVladimir Marko <vmarko@google.com>
Tue, 14 Mar 2017 15:44:22 +0000 (15:44 +0000)
committerVladimir Marko <vmarko@google.com>
Wed, 15 Mar 2017 10:25:52 +0000 (10:25 +0000)
commita22a656c7a641243f1ea989d32231d1962331d29
treefa25fb8ff611aad39838efeb900485082c948bb6
parentfbe1516b91f2117bb9c7282aaea5537572f62dd7
Fix RegType invariant checks.

Move the checks from the base constructor to constructors of
the most derived classes. While in the base constructor, the
vtable points to the base class implementations of virtual
function, so we were not checking what we intended. And when
the check failed, we tried to call a pure virtual function
RegType::Dump() and crashed while constructing an abort
message.

Also, avoid an unnecessary std::string construction in
RegType::CheckInvariants() as StringPiece can be compared
with const char* directly.

Test: testrunner.py --host
Bug: 32548008
Change-Id: Ice7ca298132f87f8b1671b6578aeec221f0e7930
runtime/verifier/reg_type.cc
runtime/verifier/reg_type.h