Skip to content

Commit

Permalink
unsigned cast to positive integer
Browse files Browse the repository at this point in the history
  • Loading branch information
jtenner committed Apr 28, 2020
1 parent dd064fb commit 252c4a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/test/TestContext.ts
Expand Up @@ -1003,7 +1003,8 @@ export class TestContext {
* a default value.
*/
protected getString(pointer: number, defaultValue: string): string {
if (pointer <= 0) return defaultValue;
pointer >>>= 0;
if (pointer === 0) return defaultValue;
if (this.cachedStrings.has(pointer)) return this.cachedStrings.get(pointer)!;
const result = this.wasm!.__getString(pointer);
this.cachedStrings.set(pointer, result);
Expand Down

0 comments on commit 252c4a9

Please sign in to comment.