aboutsummaryrefslogtreecommitdiff
path: root/pc.l
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-30 13:26:59 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-04 13:17:51 -0400
commit4c71083b074b5af0493d540bf8b971b2dc07311a (patch)
treed217e862470c2714d8a72d0115b29832e490265d /pc.l
parente398b0beb33047b22a73d2d6a4302996dcdda67a (diff)
Fix func_info members initialized after malloc
Diffstat (limited to 'pc.l')
-rw-r--r--pc.l4
1 files changed, 4 insertions, 0 deletions
diff --git a/pc.l b/pc.l
index a8cde6c..229b763 100644
--- a/pc.l
+++ b/pc.l
@@ -3,6 +3,7 @@
#include "scope.h"
#include "y.tab.h"
#include "pc.h"
+#include "assert.h"
int line_num=1;
extern scope *cur_scope;
@@ -38,6 +39,9 @@ input {
node *tmp;
tmp = scope_insert(cur_scope, strdup("write"));
tmp->func_info = malloc(sizeof(struct fi));
+ assert(tmp->func_info);
+ tmp->func_info->argc = -1;
+ tmp->func_info->argv = NULL;
return IO;
}