mirror of
https://github.com/zrax/pycdc.git
synced 2026-06-23 11:34:07 +00:00
Address comments
This commit is contained in:
parent
e8e10f1419
commit
d8c6fdf711
3 changed files with 26 additions and 16 deletions
14
pyc_code.cpp
14
pyc_code.cpp
|
|
@ -133,23 +133,23 @@ int _parse_varint(PycBuffer& data, int& pos) {
|
|||
int b = data.getByte();
|
||||
pos += 1;
|
||||
|
||||
int val = b & 63;
|
||||
while (b & 64) {
|
||||
int val = b & 0x3F;
|
||||
while (b & 0x40) {
|
||||
val <<= 6;
|
||||
|
||||
b = data.getByte();
|
||||
pos += 1;
|
||||
|
||||
val |= (b & 63);
|
||||
val |= (b & 0x3F);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
std::vector<PycCode::exception_table_entry_t> PycCode::exceptTableEntries() const
|
||||
std::vector<PycExceptionTableEntry> PycCode::exceptionTableEntries() const
|
||||
{
|
||||
PycBuffer data(m_exceptTable->value(), m_exceptTable->length());
|
||||
|
||||
std::vector<exception_table_entry_t> entries;
|
||||
std::vector<PycExceptionTableEntry> entries;
|
||||
|
||||
int pos = 0;
|
||||
while (!data.atEof()) {
|
||||
|
|
@ -164,8 +164,8 @@ std::vector<PycCode::exception_table_entry_t> PycCode::exceptTableEntries() cons
|
|||
int depth = dl >> 1;
|
||||
bool lasti = bool(dl & 1);
|
||||
|
||||
entries.emplace_back(start, end, target, depth, lasti);
|
||||
entries.push_back(PycExceptionTableEntry(start, end, target, depth, lasti));
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue