aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2014-01-20 21:37:09 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2014-01-20 21:43:07 -0200
commit868597f42de272f13297458f5e327717488ea191 (patch)
tree3407d1272ffa514b1524daf39d906af58d595e48
parenteina/mp/one_big: fix alignment issues. (diff)
downloadefl-868597f42de272f13297458f5e327717488ea191.tar.gz
eet_data: guarantee double-word alignment for temporary stack buffer.
The code was giving enough memory to store doubles and longs, but they could be unaligned as "unsigned char" allows 1-byte alignment, while double may require 8 bytes. By specifying the array as "long long" we force certain alignment in a platform independent way. As this array is small enough and short-lived, the number of items were not changed, this results in more bytes on the stack but it shouldn't matter.
-rw-r--r--src/lib/eet/eet_data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index 33134b29a0..de57a1c51d 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -3629,7 +3629,7 @@ _eet_data_descriptor_decode(Eet_Free_Context *context,
if (!edd && group_type == EET_G_UNKNOWN && IS_SIMPLE_TYPE(type))
{
- unsigned char dd[128];
+ unsigned long long dd[128];
ret = eet_data_get_type(ed,
type,
@@ -4516,7 +4516,7 @@ eet_data_get_unknown(Eet_Free_Context *context,
if (IS_SIMPLE_TYPE(type))
{
- unsigned char dd[128];
+ unsigned long long dd[128];
ret = eet_data_get_type(ed,
type,