Description
#2072 disabled 3-byte structs passed or returned by value because of a discovered bug #2022. This could potentially be re-enabled, but the code path for the 3-byte case is in need of a review.
The disabled implementation was allowing 3-byte structs to be passed like a 4-byte value, but this had a flaw that could write 4 bytes instead of 3 to the calling stack as it returns, corrupting memory. It's possible the corresponding pass-by-value could have a similar problem and it must be carefully reviewed.
A test has been created test/val/struct-by-value.c which has a commented out 3-byte case, which should be un-commented if this feature is restored. (Also don't forget to update the documentation.)
.
#2079 #2127 covers the broader topic of allowing larger structs to be passed this way. Apparently larger structs were supported by value as late as 2.19 but we have since lost the ability. (Of course it was never documented that we had this.)
If this is re-introduced, perhaps the same arbitrary-sized pass/return could be used for the 3-byte case as well.