-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CIR][CIRGen] Fix zero-offset global view access
Instead of ignoring global view access with zero offset, we should properly dereference the global type to prevent type-matching errors. This patch also fixes other two issues: - An extra index was wrongly added to the global view access. E.g. for an access like `a[0]` would generate a GV with 2 zero indexes. The indexes, however, do not take the pointer wrapping the global type into account. - When assigning the address of a complete type to an incomplete one the complete type would override the incomplete destination type, causing inconsistencies during CodeGen. For example, given `int a[3];` and `int (*ptr_a)[] = &a;`, despite `ptr_a`, in CIR it would be considered complete. Fixes #329
- Loading branch information
1 parent
90a1894
commit 6074676
Showing
3 changed files
with
56 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters