This is an archive of the discontinued LLVM Phabricator instance.

[MC] Fix constant pools with DenseMap sentinel values
ClosedPublic

Authored by olista01 on May 30 2017, 2:03 AM.

Details

Summary

The MC ConstantPool class uses a DenseMap to track generated constants, with the int64_t value of the constant as the key. This fails when values of 0x7fffffffffffffff or0x7ffffffffffffffe are inserted into the constant pool, as these are sentinel values for DenseMap.

The fix is to use std::map instead, which doesn't use sentinel values.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.May 30 2017, 2:03 AM
SjoerdMeijer accepted this revision.May 30 2017, 2:13 AM

Looks good to me.

This revision is now accepted and ready to land.May 30 2017, 2:13 AM
This revision was automatically updated to reflect the committed changes.