diff options
Diffstat (limited to 'libgfortran/caf/single.c')
-rw-r--r-- | libgfortran/caf/single.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c index cf78a1a..8d3bcbf 100644 --- a/libgfortran/caf/single.c +++ b/libgfortran/caf/single.c @@ -141,9 +141,12 @@ _gfortran_caf_register (size_t size, caf_register_t type, caf_token_t *token, caf_single_token_t single_token; if (type == CAF_REGTYPE_LOCK_STATIC || type == CAF_REGTYPE_LOCK_ALLOC - || type == CAF_REGTYPE_CRITICAL || type == CAF_REGTYPE_EVENT_STATIC - || type == CAF_REGTYPE_EVENT_ALLOC) + || type == CAF_REGTYPE_CRITICAL) local = calloc (size, sizeof (bool)); + else if (type == CAF_REGTYPE_EVENT_STATIC || type == CAF_REGTYPE_EVENT_ALLOC) + /* In the event_(wait|post) function the counter for events is a uint32, + so better allocate enough memory here. */ + local = calloc (size, sizeof (uint32_t)); else if (type == CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY) local = NULL; else |