Mercurial > hg > CbC > CbC_gcc
comparison CbC-examples/c-next.c @ 144:8f4e72ab4e11
fix segmentation fault caused by nothing next cur_op to end
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 23 Dec 2018 21:23:56 +0900 |
parents | 76e1cf5455ef |
children |
comparison
equal
deleted
inserted
replaced
143:76e1cf5455ef | 144:8f4e72ab4e11 |
---|---|
78 goto i->main_ret(0,i->env); | 78 goto i->main_ret(0,i->env); |
79 } | 79 } |
80 | 80 |
81 | 81 |
82 int interp_run(MVMThreadContext *tc){ | 82 int interp_run(MVMThreadContext *tc){ |
83 INTER inter = {0,0,0,0,0,0,0,0}; | 83 INTER inter = {0,0,0,0,0,0,0,0,0}; |
84 INTERP i = &inter; | 84 INTERP i = &inter; |
85 MVMuint16 cur_op[] = {0,1,1,0,1,2}; | 85 MVMuint16 cur_op[] = {0,1,1,0,1,2,3}; |
86 i->main_ret = _CbC_return; | 86 i->main_ret = _CbC_return; |
87 i->env = _CbC_environment; | 87 i->env = _CbC_environment; |
88 i->cur_op = (MVMuint8 *)cur_op; | 88 i->cur_op = (MVMuint8 *)cur_op; |
89 | 89 |
90 tc->interp_cur_op = &i->cur_op; | 90 tc->interp_cur_op = &i->cur_op; |