Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

Fix bad LoadInst compat for LLVM 11 #739

Merged
merged 5 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/vcpkg_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ jobs:
# --help return non-zero and fails...
mcsema-lift-${{ matrix.llvm }}.0 --version
mcsema-disass-2 --help
mcsema-lift-${{ matrix.llvm }}.0 --arch amd64 --os linux --cfg ./tests/test_suite_generator/generated/prebuilt_cfg/amd64/linux/cfg/hello_world --output hello_world.bc
mcsema-lift-${{ matrix.llvm }}.0 --arch x86 --os linux --cfg ./tests/test_suite_generator/generated/prebuilt_cfg/x86/linux/cfg/hello_world --output hello_world.bc

build_mac:
strategy:
fail-fast: false
matrix:
os: [
'macos-11.0'
'macos-10.15'
]
llvm: [
'11'
Expand Down
2 changes: 1 addition & 1 deletion mcsema/BC/Optimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1542,7 +1542,7 @@ static void GlobalizeStateStructures(void) {
#if LLVM_VERSION_NUMBER < LLVM_VERSION(11, 0)
new llvm::LoadInst(ptr, load->getName(), load)
#else
new llvm::LoadInst(ptr->getType(), ptr, load->getName(), load)
new llvm::LoadInst(ptr->getType()->getPointerElementType(), ptr, load->getName(), load)
#endif
);
to_remove.push_back(itp);
Expand Down