aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils2.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-10-11 09:49:37 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-11 11:49:37 +0200
commit9c8e862b2ed66d94be79af62b3a323f902f1032b (patch)
tree9594c1a01efaaa2774cdb28b86a2da014d6d3f16 /gcc/ada/gcc-interface/utils2.c
parent76e3504fad8d01df1ac2cc110051f593fdf49faf (diff)
downloadgcc-9c8e862b2ed66d94be79af62b3a323f902f1032b.zip
gcc-9c8e862b2ed66d94be79af62b3a323f902f1032b.tar.gz
gcc-9c8e862b2ed66d94be79af62b3a323f902f1032b.tar.bz2
utils2.c (maybe_wrap_malloc): Fix crash when allocating very large object on VMS.
2010-10-11 Tristan Gingold <gingold@adacore.com> * gcc-interface/utils2.c (maybe_wrap_malloc): Fix crash when allocating very large object on VMS. From-SVN: r165288
Diffstat (limited to 'gcc/ada/gcc-interface/utils2.c')
-rw-r--r--gcc/ada/gcc-interface/utils2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 8419170..62380de 100644
--- a/gcc/ada/gcc-interface/utils2.c
+++ b/gcc/ada/gcc-interface/utils2.c
@@ -1820,9 +1820,10 @@ maybe_wrap_malloc (tree data_size, tree data_type, Node_Id gnat_node)
/* On VMS, if pointers are 64-bit and the allocator size is 32-bit or
Convention C, allocate 32-bit memory. */
if (TARGET_ABI_OPEN_VMS
- && (POINTER_SIZE == 64
- && (UI_To_Int (Esize (Etype (gnat_node))) == 32
- || Convention (Etype (gnat_node)) == Convention_C)))
+ && POINTER_SIZE == 64
+ && Nkind (gnat_node) == N_Allocator
+ && (UI_To_Int (Esize (Etype (gnat_node))) == 32
+ || Convention (Etype (gnat_node)) == Convention_C))
malloc_ptr = build_call_1_expr (malloc32_decl, size_to_malloc);
else
malloc_ptr = build_call_1_expr (malloc_decl, size_to_malloc);