wichtounet / eddic

Compiler of the EDDI programming language
MIT License
33 stars 4 forks source link

Use the copy constructor when passing struct by values #46

Closed wichtounet closed 11 years ago

wichtounet commented 11 years ago

Now, when struct are passed by value, there content is simply copied on the stack. But it is not always enough, for instance, when the structure contains a dynamic arrays or pointers, the copy could edit values of the source structure.

The copy should be copy constructed before being passed by value.