mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 20:01:22 +00:00
Verify sizes when trying to read a VBR
Also added an assert to ReadVBR64. llvm-svn: 234984
This commit is contained in:
1 parent
c640ff63e2
commit
7dc896fcce
4 files changed
+8
No files matched your search
@@ -62,6 +62,8 @@ static uint64_t readAbbreviatedField(BitstreamCursor &Cursor,
|
||||
case BitCodeAbbrevOp::Fixed:
|
||||
return Cursor.Read((unsigned)Op.getEncodingData());
|
||||
case BitCodeAbbrevOp::VBR:
|
||||
if ((unsigned)Op.getEncodingData() > 64)
|
||||
report_fatal_error("Invalid record");
|
||||
return Cursor.ReadVBR64((unsigned)Op.getEncodingData());
|
||||
case BitCodeAbbrevOp::Char6:
|
||||
return BitCodeAbbrevOp::DecodeChar6(Cursor.Read(6));
|
||||
|
||||
Reference in new issue
Block a user