From 78a3191f2ab5fb1fd26962d0cbe3003b3f32947c Mon Sep 17 00:00:00 2001 From: Malte Stellmacher Date: Mon, 5 Feb 2024 13:48:10 +0100 Subject: [PATCH] Check for identity instead of equality should fix native builds --- .../nodes/plugins/ffi/InterpreterProxy.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java index fda8e68ce..315bdce6d 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/nodes/plugins/ffi/InterpreterProxy.java @@ -172,11 +172,12 @@ private int addObjectToRegistry(final Object object) { } private int oopFor(final Object object) { - int oop = objectRegistry.indexOf(object); - if (oop < 0) { - oop = addObjectToRegistry(object); + for (int oop = 0; oop < objectRegistry.size(); oop++) { + if (objectRegistry.get(oop) == object) { + return oop; + } } - return oop; + return addObjectToRegistry(object); } ///////////////////