-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from AjayBrahmakshatriya/master
Fixed var hoister to convert reference types to pointer types when hoisting
- Loading branch information
Showing
7 changed files
with
93 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
void bar (void) { | ||
int z_1; | ||
int z_3; | ||
int* k_4; | ||
int y_0 = 0; | ||
int m_1; | ||
int n_2; | ||
if (y_0) { | ||
z_1 = 1; | ||
z_3 = 1; | ||
k_4 = (&(m_1)); | ||
} else { | ||
z_1 = 2; | ||
z_3 = 2; | ||
k_4 = (&(m_1)); | ||
} | ||
int b_2; | ||
int a_3 = z_1; | ||
int b_5; | ||
int a_6 = z_3; | ||
z_3 = z_3 + k_4[0]; | ||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
void bar (void) { | ||
int var1; | ||
int var3; | ||
int* var4; | ||
int var0 = 0; | ||
int var1; | ||
int var2; | ||
if (var0) { | ||
var1 = 1; | ||
var3 = 1; | ||
var4 = (&(var1)); | ||
} else { | ||
var1 = 2; | ||
var3 = 2; | ||
var4 = (&(var1)); | ||
} | ||
int var2; | ||
int var3 = var1; | ||
int var5; | ||
int var6 = var3; | ||
var3 = var3 + var4[0]; | ||
} | ||
|
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