Skip to content

Commit

Permalink
Simplify untagRib
Browse files Browse the repository at this point in the history
Removing a misleading comment.

This is the one we probably want to inline somehow.
  • Loading branch information
mossprescott committed Apr 23, 2024
1 parent cebb4c0 commit 0fb6394
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions alt/scheme/Obj.jack
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ class Obj {
/* Convert to a raw pointer. */
function Rib untagRib(Obj obj) {
// TODO: (optionally) check the tag bit
var int raw;

// Note: first negate to avoid overflow
let raw = -obj;
return raw + raw + raw;
return -(obj + obj + obj);
}

/* Strip off the sig bit. */
Expand Down

0 comments on commit 0fb6394

Please sign in to comment.