mirror of https://github.com/tbklang/tlang.git
Code gen: Casted pointer offets #140
Labels
No Label
dependency
emit
hashmapper
lebanonmapper
lexer
meta
needsfix
parser
qol
question
resolution
typing
No Milestone
No project
No Assignees
1 Participants
Notifications
Total Time Spent: 14 minutes 44 seconds
Due Date
deavmi
14 minutes 44 seconds
Blocks
Reference: tlang/tlang#140
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What is this?
C compiler's do this thing where: if
<a>
is a pointer and<b>
is an integer then the following pointer arithmetic is allowed:But it's WRONG if you do:
Even though it makes logical sense coercion wise. Therefore we need to check such a case and yank the cast out me thinks.
This is being worked on as part of #115
In commit
29d7cb7451b02ea6ab1ae736ede0e3094ca0d00d
(and prior):CastedValueInstruction
CastedValueInstruction
's relaxationBinaryOpInstr
is aPointer
, the assumption is thatTypeChecker
would have coerced the non-pointer operseand to aCastedValueInstruction
Marking this as closed for now as it seems correct
Made debug messages better for when this is used in
DGen
in commita342fdcb93efb76272d5684cdf216e5e0a6122d1