Skip to content

Commit

Permalink
Sync with RDIL API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax89 committed Apr 2, 2022
1 parent f33bb0d commit af82938
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions compiler/msvc/msvccompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ std::optional<rd_address> MSVCCompiler::extractInitTermArg(RDContext* ctx, rd_ad
rd_ptr<RDILExpression> e(RDILExpression_Create(ctx, address));
if(!e || (RDILExpression_Type(e.get()) != RDIL_Push)) return std::nullopt;

auto* exprval = RDILExpression_Extract(e.get(), "u:cnst");
if(!exprval) return std::nullopt;

RDILValue val;
if(!RDILExpression_GetValue(exprval, &val)) return std::nullopt;
return val.address;
const RDILValue* values = nullptr;
size_t n = RDILExpression_ExtractNew(e.get(), &values);
if(!n || values[0].type != RDIL_Cnst) return std::nullopt;
return values[0].address;
}

void MSVCCompiler::parseInitTerm(RDContext* ctx, rd_address address)
Expand Down
8 changes: 4 additions & 4 deletions compiler/msvc/rtti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ void MSVCRTTI::search()
if(!expr) break;
if(!RDILExpression_Match(expr, "[cnst]=cnst") && !RDILExpression_Match(expr, "[reg]=cnst")) continue;

RDILValue val;
expr = RDILExpression_Extract(expr, "src:cnst");
if(!expr || !RDILExpression_GetValue(expr, &val) || !RD_IsAddress(m_context, val.address)) continue;
checkVTable(val.address);
const RDILValue* values = nullptr;
size_t n = RDILExpression_ExtractNew(expr, &values);
if(!n || values[0].type != RDIL_Cnst || !RD_IsAddress(m_context, values[0].address)) continue;
checkVTable(values[0].address);
}
}

Expand Down

0 comments on commit af82938

Please sign in to comment.