We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47e4b8e commit 5b51a13Copy full SHA for 5b51a13
std/assembly/rt.ts
@@ -27,10 +27,10 @@ export function __typeinfo(id: u32): TypeinfoFlags {
27
@unsafe
28
export function __instanceof(ptr: usize, classId: u32): bool { // keyword
29
var id = changetype<OBJECT>(ptr - TOTAL_OVERHEAD).rtId;
30
- var ptr = __rtti_base;
31
- if (id <= load<u32>(ptr)) {
+ var rttiBase = __rtti_base;
+ if (id <= load<u32>(rttiBase)) {
32
do if (id == classId) return true;
33
- while (id = changetype<Typeinfo>(ptr + sizeof<u32>() + id * offsetof<Typeinfo>()).base);
+ while (id = changetype<Typeinfo>(rttiBase + sizeof<u32>() + id * offsetof<Typeinfo>()).base);
34
}
35
return false;
36
0 commit comments