diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-09-28 23:02:04 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-09-29 21:53:21 -0400 |
commit | 7605f2254536db2052690f0b91ff8110ab8a6828 (patch) | |
tree | 6d15900362dc443acacaf62a515965b1f25c000e | |
parent | e6234f0793c3e7d9978831d884d420a5dbb5bfb1 (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.l | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |