Skip to content

Commit 97996ed

Browse files
committed
Add pointer difference support
This improves the support for pointer difference calculations and refactors the parser by extracting complex pointer arithmetic logic into well-named helper functions. Limitation: Integer pointer differences (e.g., 'int *q - int *p') are not fully supported due to type information loss in the compilation pipeline. When pointer variables are loaded for use in expressions, they become temporaries without sufficient type information to determine element size for proper scaling. Workaround: For integer pointer differences, cast to char* and divide manually: ((char *) q - (char *) p) / sizeof(int) Character pointer differences work correctly because element size is 1, requiring no scaling.
1 parent 97b4f78 commit 97996ed

File tree

2 files changed

+441
-88
lines changed

2 files changed

+441
-88
lines changed

0 commit comments

Comments
 (0)