From 1fc3cd833f19ffa534f04caf541e88042124fd91 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Tue, 25 Feb 2025 20:32:24 -0500 Subject: Remove platform registration API footgun. Turns out, you can just pass this thing an architecture that is *completely* different from the one in the platform you are also passing in and it'll just happily do the wrong thing. While that's pretty wild, I'm in favor of not having to make this particular mistake again the next time I copy/paste some code, so we're now deprecating it. --- platform/freebsd/platform_freebsd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'platform/freebsd') diff --git a/platform/freebsd/platform_freebsd.cpp b/platform/freebsd/platform_freebsd.cpp index 8aa28f7f..d25bbc08 100644 --- a/platform/freebsd/platform_freebsd.cpp +++ b/platform/freebsd/platform_freebsd.cpp @@ -113,7 +113,7 @@ extern "C" platform = new FreeBSDX86Platform(x86); Platform::Register("freebsd", platform); - BinaryViewType::RegisterPlatform("ELF", 9, x86, platform); + BinaryViewType::RegisterPlatform("ELF", 9, platform); } Ref x64 = Architecture::GetByName("x86_64"); @@ -123,7 +123,7 @@ extern "C" platform = new FreeBSDX64Platform(x64); Platform::Register("freebsd", platform); - BinaryViewType::RegisterPlatform("ELF", 9, x64, platform); + BinaryViewType::RegisterPlatform("ELF", 9, platform); } Ref armv7 = Architecture::GetByName("armv7"); @@ -138,7 +138,7 @@ extern "C" thumbPlatform->AddRelatedPlatform(armv7, armPlatform); Platform::Register("freebsd", armPlatform); Platform::Register("freebsd", thumbPlatform); - BinaryViewType::RegisterPlatform("ELF", 9, armv7, armPlatform); + BinaryViewType::RegisterPlatform("ELF", 9, armPlatform); } Ref arm64 = Architecture::GetByName("aarch64"); @@ -148,7 +148,7 @@ extern "C" platform = new FreeBSDArm64Platform(arm64); Platform::Register("freebsd", platform); - BinaryViewType::RegisterPlatform("ELF", 9, arm64, platform); + BinaryViewType::RegisterPlatform("ELF", 9, platform); } return true; -- cgit v1.3.1