Skip to content

Commit

Permalink
[js] Fix uint8, uint16, uint32 in CUnions
Browse files Browse the repository at this point in the history
  • Loading branch information
pmurias committed Feb 20, 2018
1 parent 02f9c95 commit 17e1a13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vm/js/nqp-runtime/reprs.js
Expand Up @@ -687,11 +687,11 @@ class P6int extends REPR {

asRefType() {
if (this.bits === 8) {
return ref.types.int8;
return this.isUnsigned ? ref.types.uint8 : ref.types.int8;
} else if (this.bits === 16) {
return ref.types.int16;
return this.isUnsigned ? ref.types.uint16 : ref.types.int16;
} else if (this.bits === 32) {
return ref.types.int32;
return this.isUnsigned ? ref.types.uint32 : ref.types.int32;
} else {
throw new NQPException(`Unsupported use in lowlevel contex, bits: ${this.bits}`);
}
Expand Down

0 comments on commit 17e1a13

Please sign in to comment.