-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix elaboration of function definitions with nested function types
Since commit ea3a41b, `elab_type_declarator` has a special case for function definitions, causing it to include the function parameters in the returned updated typing environment. However, this special case was wrong for nested function types such as ``` int (*f(int y))(int x) { ... } ``` `f` is a function taking an `y` parameter and returning a function `(x: int) -> int`. The special case causes both `x` and `y` to be included in the returned environment, while only `y` should be. This commit makes sure that the special case for function definitions applies only to the outermost function type, i.e. the innermost `Cabs.PROTO` declarator. A similar issue was handled correctly in the `Cabs.PROTO_OLD` case, so this commit tries to use the same code structure in the `PROTO` and `PROTO_OLD` cases.
- Loading branch information
1 parent
3f217e3
commit ec033c3
Showing
3 changed files
with
25 additions
and
18 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
Submodule test
updated
7 files
+2 −2 | regression/Makefile | |
+1 −0 | regression/Results/alias | |
+2 −0 | regression/Results/dollars | |
+1 −0 | regression/Results/extern2 | |
+14 −0 | regression/alias.c | |
+28 −0 | regression/dollars.c | |
+16 −0 | regression/extern2.c |