Skip to content
Snippets Groups Projects
Commit fffd1850 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

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.
parent c6999ac0
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment