You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IRToASTVisitor: preserve native calling conventions in declarations and calls #347
Rellic v0.2.3 creates function declarations using a default Clang FunctionProtoType::ExtProtoInfo. It does not copy Function::getCallingConv().
Calls through function pointers similarly construct a default C function type
without reading CallInst::getCallingConv().
An LLVM module with x86_stdcallcc, x86_fastcallcc, and x86_thiscallcc
therefore becomes plain C declarations, definitions, and indirect calls. This
changes argument registers and stack cleanup when the result is compiled for i686-pc-windows-msvc.
A synthetic module contains eight functions: four sum functions with different
conventions, one caller, and three callers through pointers. For example, these
are declarations and a call from the synthetic module:
The generated declarations are currently ordinary C declarations, and the
pointer call has an ordinary C pointer cast. A static roundtrip can be checked
without executing argument cases:
The return to LLVM drops the three named native conventions. A local fix
preserves both Clang function-type conventions and printed declaration
attributes, and creates convention-bearing typedefs for indirect calls. The
typedefs avoid invalid placement of attributes inside a C cast type-name.
Unsupported LLVM-only conventions produce an explicit error.
Static comparison of the complete synthetic module linked as two DLLs gives
byte-exact code for the four individual sum functions and all three indirect
callers. The combined caller has an instruction-ordering difference after
optimization; that difference is retained in the report.
No third-party binary, machine-code sample, runtime inputs, local identifiers,
or product-specific information is included in this report.
Activity