[WebAssembly] Add an assertion to catch unexpected MCFixupKindInfo flags.

llvm-svn: 257657
This commit is contained in:
Dan Gohman 2016-01-13 19:31:57 +00:00
parent 983ad65220
commit a39ca60126
1 changed files with 2 additions and 0 deletions

View File

@ -73,6 +73,8 @@ void WebAssemblyAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
unsigned DataSize, uint64_t Value,
bool IsPCRel) const {
const MCFixupKindInfo &Info = getFixupKindInfo(Fixup.getKind());
assert(Info.Flags == 0 && "WebAssembly does not use MCFixupKindInfo flags");
unsigned NumBytes = (Info.TargetSize + 7) / 8;
if (Value == 0)
return; // Doesn't change encoding.