From 9f5f36de2dbe661e97bb374d399850e96a5e3662 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Sun, 15 Sep 2019 01:49:52 -0500 Subject: [PATCH] Switch: Fix rubberband crash, re-appeared in latest toolchain --- CMakeLists.txt | 2 +- src/others/Rubberband.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8ba84bc5..9f108ed75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -513,7 +513,7 @@ if(BUILD_NX) -fif-conversion2 -finline-functions-called-once -fipa-profile -#the commented three flags here cause the crash in rubberbands.cc +#the commented three flags here used to cause a crash in rubberbands.cc (see FIXME comment there) #-fipa-pure-const -fipa-reference #-fmerge-constants diff --git a/src/others/Rubberband.cc b/src/others/Rubberband.cc index 76db2f0d3..019f6c140 100644 --- a/src/others/Rubberband.cc +++ b/src/others/Rubberband.cc @@ -38,7 +38,10 @@ namespace enigma { anchor1 = dynamic_cast((Object *)val); ASSERT(anchor1 != NULL, XLevelRuntime, "Rubberband: 'anchor1' is no actor"); ASSERT(anchor1 != anchor2.ac, XLevelRuntime, "Rubberband: 'anchor1' is identical to 'anchor2'"); +#ifndef __SWITCH__ + // FIXME causes crash on Switch when loading any level with rubberbands switchAnchor(old, anchor1, anchor2Object()); +#endif } else if (key == "anchor2") { Object * old = anchor2Object(); Object * obj = val;