Skip to content

Commit 17e1a13

Browse files
committed
[js] Fix uint8, uint16, uint32 in CUnions
1 parent 02f9c95 commit 17e1a13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/vm/js/nqp-runtime/reprs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ class P6int extends REPR {
687687

688688
asRefType() {
689689
if (this.bits === 8) {
690-
return ref.types.int8;
690+
return this.isUnsigned ? ref.types.uint8 : ref.types.int8;
691691
} else if (this.bits === 16) {
692-
return ref.types.int16;
692+
return this.isUnsigned ? ref.types.uint16 : ref.types.int16;
693693
} else if (this.bits === 32) {
694-
return ref.types.int32;
694+
return this.isUnsigned ? ref.types.uint32 : ref.types.int32;
695695
} else {
696696
throw new NQPException(`Unsupported use in lowlevel contex, bits: ${this.bits}`);
697697
}

0 commit comments

Comments
 (0)