From 277853187395f96be6d652cc30b71a2a12748730 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Wed, 16 Jul 2014 08:59:50 -0600 Subject: [PATCH] fix arm build --- src/builtin.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/builtin.cpp b/src/builtin.cpp index b4aaff4fed..ecf414e392 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -74,11 +74,16 @@ GcField* fieldForOffsetInClass(Thread* t, GcClass* c, unsigned offset) return 0; } -GcField* fieldForOffset(Thread* t, GcSingleton* o, unsigned offset) +GcField* fieldForOffset(Thread* t, object o, unsigned offset) { GcClass* c = objectClass(t, o); if (c->vmFlags() & SingletonFlag) { - c = cast(t, singletonObject(t, o, 0)); + GcSingleton* s = cast(t, o); + + // If the object is a Singleton, we assume it's the static table of a class - + // which will always have the parent class as the first (0th) element. + c = cast(t, singletonObject(t, s, 0)); + object table = c->fieldTable(); if (table) { for (unsigned i = 0; i < objectArrayLength(t, table); ++i) {