aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorChris Manghane <cmang@google.com>2016-10-06 19:24:04 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-10-06 19:24:04 +0000
commit4c4430e390301324e48b70ceb7b882fedd18aa15 (patch)
treebddfd079934702f295decb4ab8dbf7a41210f519 /gcc/go
parentf31276858a7182663abc0f91fd8961231191b9ed (diff)
downloadgcc-4c4430e390301324e48b70ceb7b882fedd18aa15.zip
gcc-4c4430e390301324e48b70ceb7b882fedd18aa15.tar.gz
gcc-4c4430e390301324e48b70ceb7b882fedd18aa15.tar.bz2
go-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the returned memory.
* go-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the returned memory. From-SVN: r240840
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/ChangeLog5
-rw-r--r--gcc/go/go-gcc.cc3
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog
index 7292b2b..b6d1e9f 100644
--- a/gcc/go/ChangeLog
+++ b/gcc/go/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-06 Chris Manghane <cmang@google.com>
+
+ * go-gcc.cc (Gcc_backend::stack_allocation_expression): Clear the
+ returned memory.
+
2016-09-27 Than McIntosh <thanm@google.com>
* go-linemap.cc (Gcc_linemap::to_string): New method.
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 57c2bee..b3701bf 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -2048,6 +2048,9 @@ Gcc_backend::stack_allocation_expression(int64_t size, Location location)
tree alloca = builtin_decl_explicit(BUILT_IN_ALLOCA);
tree size_tree = build_int_cst(integer_type_node, size);
tree ret = build_call_expr_loc(location.gcc_location(), alloca, 1, size_tree);
+ tree memset = builtin_decl_explicit(BUILT_IN_MEMSET);
+ ret = build_call_expr_loc(location.gcc_location(), memset, 3,
+ ret, integer_zero_node, size_tree);
return this->make_expression(ret);
}