PLTools / Lama

Teaching language LaMa for a compiler course
GNU General Public License v3.0
70 stars 37 forks source link

TO_SEXP #26

Open FeggieBoss opened 11 months ago

FeggieBoss commented 11 months ago

https://github.com/PLTools/Lama/blob/be0b32f7b9c75e61eff377cd34d4f65ebeeca204/runtime/runtime_common.h#L28 https://github.com/PLTools/Lama/blob/be0b32f7b9c75e61eff377cd34d4f65ebeeca204/runtime/runtime_common.h#L29 Is it suppose to be SEXP_HEADER_SZ ((sizeof(int) + sizeof(size_t) + sizeof(int))) in TO_SEXP?

danyaberezun commented 11 months ago

No. It may be an unfortunate naming but there is no bug here. TO_SEXP accepts a raw pointer which in case of s-expression is actually a pointer to s-expression's tag rather than to "raw" data.