From 0fb6394654d6e3e0c3abce3a6b5b8809aac4ee4c Mon Sep 17 00:00:00 2001 From: Moss Prescott Date: Tue, 23 Apr 2024 08:53:32 -0400 Subject: [PATCH] Simplify untagRib Removing a misleading comment. This is the one we probably want to inline somehow. --- alt/scheme/Obj.jack | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/alt/scheme/Obj.jack b/alt/scheme/Obj.jack index ec9b52a..6b8062b 100644 --- a/alt/scheme/Obj.jack +++ b/alt/scheme/Obj.jack @@ -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. */