From 400cbf325c7cb03217a0e869b988d70fdb21ba2f Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 30 Oct 2008 02:43:43 +0000 Subject: [PATCH] (mface_get_prop): Fix strict aliasing bug. (mface_put_prop): Likewise. --- src/face.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/face.c b/src/face.c index 18fd03e..cd13c0e 100644 --- a/src/face.c +++ b/src/face.c @@ -1853,7 +1853,7 @@ mface_get_prop (MFace *face, MSymbol key) { if (key == Mhook_func) /* This unsafe code is for backward compatiblity. */ - return *(void **) &face->hook; + return (void *) face->hook; MERROR (MERROR_FACE, NULL); } return face->property[index]; @@ -1938,9 +1938,9 @@ mface_put_prop (MFace *face, MSymbol key, void *val) if (key == Mhook_func) { /* This unsafe code is for backward compatiblity. */ - if (*(void **) &face->hook == val) + if (face->hook == (MFaceHookFunc) val) return 0; - *(void **) &face->hook = val; + face->hook = (MFaceHookFunc) val; } else { -- 1.7.10.4