eolian: fix potential ABI violation in expr serialization

While this may seem safe, and likely is on any 64-bit system,
it may not be entirely well defined. And in this case we should
not have to worry about copying.

Maybe fixes T8276...
This commit is contained in:
Daniel Kolesa 2019-09-30 11:28:32 +02:00
parent 5ac1f52af9
commit 27291b4486
1 changed files with 4 additions and 2 deletions

View File

@ -152,8 +152,10 @@ _expr_serialize(const Eolian_Expression *expr, Eina_Strbuf *buf, Eina_Bool outer
case EOLIAN_EXPR_STRING:
case EOLIAN_EXPR_CHAR:
{
Eolian_Value *v = (Eolian_Value*)&expr->type;
const char *x = eolian_expression_value_to_literal(v);
Eolian_Value v;
v.type = expr->type;
v.value = expr->value;
const char *x = eolian_expression_value_to_literal(&v);
if (!x)
return EINA_FALSE;
eina_strbuf_append(buf, x);