From d5690a001e0ba19a1f80998005be8f79ca475223 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 7 Dec 2018 17:00:32 -0500 Subject: [PATCH] Do not assume `return_copy` receives an object. It may be passed a call instead, in which case we want to refer to the call as a local variable instead of making that call more than once! --- include/cyclone/types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cyclone/types.h b/include/cyclone/types.h index d5544f50..ea8134d8 100644 --- a/include/cyclone/types.h +++ b/include/cyclone/types.h @@ -1351,9 +1351,10 @@ typedef union { complex_num_type complex_num_t; } common_type; -#define return_copy(ptr, obj) \ +#define return_copy(ptr, o) \ { \ tag_type t; \ + object obj = o; \ if (!is_object_type(obj)) \ return obj; \ t = type_of(obj); \