gpgscm: Fix compact vector encoding.

* tests/gpgscm/scheme-private.h (struct cell): Use uintptr_t for
'_flags'.  This way, '_flags' has the size of a machine word.
--

The compact vector representation introduced in 49e2ae65 requires that
we can tell apart pointers and type flags.  This did not work on
64-bit big-endian architectures.

Fixes a crash on 64-bit big-endian architectures.

Hat-tip-to: gniibe
Fixes-commit: 49e2ae65e8
Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
Justus Winter 2017-04-07 12:27:47 +02:00
parent 9c9fde1495
commit bf8b5e9042
No known key found for this signature in database
GPG Key ID: DD1A52F9DA8C9020
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
#ifndef _SCHEME_PRIVATE_H
#define _SCHEME_PRIVATE_H
#include <stdint.h>
#include "scheme.h"
/*------------------ Ugly internals -----------------------------------*/
/*------------------ Of interest only to FFI users --------------------*/
@ -42,7 +43,7 @@ typedef struct port {
/* cell structure */
struct cell {
unsigned int _flag;
uintptr_t _flag;
union {
struct {
char *_svalue;