Skip to content

Commit 840016a

Browse files
committed
native/abnativefunctions.cpp: fix ARCH variable fallback logic
1 parent ec8223e commit 840016a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

native/abnativefunctions.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,14 @@ static int set_arch_variables(const char *arch = nullptr) {
417417
}
418418

419419
// set ARCH variables
420-
auto this_arch = arch == nullptr ? std::string(ab_get_current_architecture())
421-
: std::string(arch);
420+
std::string this_arch{};
421+
if (find_variable("ARCH")) {
422+
this_arch = find_variable("ARCH")->value;
423+
} else if (arch) {
424+
this_arch = arch;
425+
} else {
426+
this_arch = ab_get_current_architecture();
427+
}
422428
// ARCH=$(abdetectarch)
423429
bind_global_variable("ARCH", const_cast<char *>(this_arch.c_str()), ASS_NOEVAL);
424430
// ABHOST=ARCH

0 commit comments

Comments
 (0)