soc2c: fix a bug occuring when copying arrays with memcpy().
Indeed, in order to copy an array, I used to generate something like memcpy(out, in, sizeof(in)); but if 'out' and 'in' are arrays, and if 'in' is an argument of a function, sizeof() considers it as a pointer, not an array !!!! note that if 'in' is a local var, sizeof(in) works fine. To fix it, I use the type of the dest (instead of the id) as argument of sizeof. nb : The pb never occured before, as in the heap mode only the ctx is passed a args of step functions.
Showing
- src/lv6MainArgs.ml 1 addition, 1 deletionsrc/lv6MainArgs.ml
- src/soc2cHeap.ml 11 additions, 10 deletionssrc/soc2cHeap.ml
- src/soc2cHeap.mli 3 additions, 3 deletionssrc/soc2cHeap.mli
- src/soc2cStack.ml 21 additions, 16 deletionssrc/soc2cStack.ml
- src/soc2cStack.mli 2 additions, 2 deletionssrc/soc2cStack.mli
- src/socPredef2cHeap.ml 14 additions, 19 deletionssrc/socPredef2cHeap.ml
- src/socPredef2cStack.ml 13 additions, 18 deletionssrc/socPredef2cStack.ml
- test/lus2lic.sum 12 additions, 12 deletionstest/lus2lic.sum
- test/lus2lic.time 7 additions, 7 deletionstest/lus2lic.time
- test/should_work/ck7.lus 1 addition, 1 deletiontest/should_work/ck7.lus
- test/should_work/ply03.lus 1 addition, 1 deletiontest/should_work/ply03.lus
- test/should_work/trivial_array.lus 1 addition, 1 deletiontest/should_work/trivial_array.lus
Loading
Please register or sign in to comment