Skip to content

Commit 5b51a13

Browse files
committed
fix
1 parent 47e4b8e commit 5b51a13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

std/assembly/rt.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ export function __typeinfo(id: u32): TypeinfoFlags {
2727
@unsafe
2828
export function __instanceof(ptr: usize, classId: u32): bool { // keyword
2929
var id = changetype<OBJECT>(ptr - TOTAL_OVERHEAD).rtId;
30-
var ptr = __rtti_base;
31-
if (id <= load<u32>(ptr)) {
30+
var rttiBase = __rtti_base;
31+
if (id <= load<u32>(rttiBase)) {
3232
do if (id == classId) return true;
33-
while (id = changetype<Typeinfo>(ptr + sizeof<u32>() + id * offsetof<Typeinfo>()).base);
33+
while (id = changetype<Typeinfo>(rttiBase + sizeof<u32>() + id * offsetof<Typeinfo>()).base);
3434
}
3535
return false;
3636
}

0 commit comments

Comments
 (0)