This is an archive of the discontinued LLVM Phabricator instance.

[llvm-exegesis] Fix serialization/deserialization of special NoRegister register (PR41448)
ClosedPublic

Authored by lebedev.ri on Apr 10 2019, 9:01 AM.

Details

Summary

A *lot* of instructions have this special register.
It seems this never really worked, but i finally noticed it only
because it happened to break for CMOV16rm instruction.

We serialized that register as "" (empty string), which is naturally
'ignored' during deserialization, so we re-create a MCInst with
too few operands.

And when we then happened to try to resolve variant sched class
for this mis-serialized instruction, and the variant predicate
tried to read an operand that was out of bounds since we got less operands,
we crashed.

Fixes PR41448.

Diff Detail

Event Timeline

lebedev.ri created this revision.Apr 10 2019, 9:01 AM
courbet accepted this revision.Apr 10 2019, 11:55 PM

Thanks Roman.

This revision is now accepted and ready to land.Apr 10 2019, 11:55 PM

Thanks Roman.

Thank you for the review!

This revision was automatically updated to reflect the committed changes.