From 0d1d51f64ed5813eefe410fb16ec60ffa32d0588 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 20 Jan 2014 21:37:09 -0200 Subject: [PATCH] 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. --- src/lib/eet/eet_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c index 2afdbf5320..b687b2e0ff 100644 --- a/src/lib/eet/eet_data.c +++ b/src/lib/eet/eet_data.c @@ -3640,7 +3640,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, @@ -4535,7 +4535,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,