From ea3ffa52d4da2260b940cb269b4e4f51ecd6bc7b Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Thu, 3 Nov 2016 11:12:57 +1100 Subject: Revert "hv.h: rework HEK_FLAGS to a proper member in struct hek" This reverts commit d3148f758506efd28325dfd8e1b698385133f0cd. SV keys are stored as pointers in the key_key, on platforms with alignment requirements (such as PA-RISC) this resulted in bus errors early in the build. --- hv.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hv.h') diff --git a/hv.h b/hv.h index 16634b7e44..ee536f08c8 100644 --- a/hv.h +++ b/hv.h @@ -45,9 +45,10 @@ struct he { struct hek { U32 hek_hash; /* hash of key */ I32 hek_len; /* length of hash key */ - char hek_flags; /* The flags associated with this key */ char hek_key[1]; /* variable-length hash key */ /* the hash-key is \0-terminated */ + /* after the \0 there is a byte for flags, such as whether the key + is UTF-8 */ }; struct shared_he { @@ -396,7 +397,7 @@ C. #define HEK_HASH(hek) (hek)->hek_hash #define HEK_LEN(hek) (hek)->hek_len #define HEK_KEY(hek) (hek)->hek_key -#define HEK_FLAGS(hek) (hek)->hek_flags +#define HEK_FLAGS(hek) (*((unsigned char *)(HEK_KEY(hek))+HEK_LEN(hek)+1)) #define HVhek_UTF8 0x01 /* Key is utf8 encoded. */ #define HVhek_WASUTF8 0x02 /* Key is bytes here, but was supplied as utf8. */ -- cgit v1.2.1