From 0ee06ac2c466149097ed411cb648dfbe17ff4098 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sat, 12 Feb 2022 13:53:35 -0500 Subject: codegen for dereference, subscript --- 05/constants.b | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '05/constants.b') diff --git a/05/constants.b b/05/constants.b index 79cd8e5..9a39ecd 100644 --- a/05/constants.b +++ b/05/constants.b @@ -152,8 +152,8 @@ ; uint type ; immediately following the header in memory are the arguments of the expression ; - for functions, a pointer to the name of the function (we don't know where it is yet) -; - for local variables, the 64-bit rbp offset (number to be subtracted from rbp) -; - for global variables, the 64-bit runtime address +; - for local variables, the 32-bit rbp offset (number to be subtracted from rbp), followed by a 32-bit number, which is 1 if the variable is an array, and 0 otherwise (we can't just check `type` because that might have been decayed into a pointer) +; - for global variables, the 32-bit runtime address, followed by 32-bit is_array ; - for constant ints, the 64-bit integral value ; - for constant floats, the 64-bit double value (even if expression has type float) ; - for unary operators, the operand -- cgit v1.2.3