aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-28 23:02:04 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-29 21:53:21 -0400
commit7605f2254536db2052690f0b91ff8110ab8a6828 (patch)
tree6d15900362dc443acacaf62a515965b1f25c000e
parente6234f0793c3e7d9978831d884d420a5dbb5bfb1 (diff)
Fix invalid freeing of read/write functions
Function names must be strdup from constants so the strings can later be freed when the scope is popped.
-rw-r--r--pc.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/pc.l b/pc.l
index 701e469..ef4fbb0 100644
--- a/pc.l
+++ b/pc.l
@@ -36,7 +36,7 @@ id [A-Za-z][A-Za-z0-9_]*
input {
node *tmp;
- tmp = scope_insert(cur_scope, "write");
+ tmp = scope_insert(cur_scope, strdup("write"));
tmp->func_info = malloc(sizeof(struct fi));
return IO;
@@ -44,7 +44,7 @@ input {
output {
node *tmp;
- tmp = scope_insert(cur_scope, "read");
+ tmp = scope_insert(cur_scope, strdup("read"));
tmp->func_info = malloc(sizeof(struct fi));
return IO;