public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* C++ PATCH for c++/63928 (uninitialized read in constexpr)
@ 2014-11-19 19:09 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2014-11-19 19:09 UTC (permalink / raw)
  To: gcc-patches List

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

We can't rely on valp continuing to be a pointer into the hash table 
slot.  I fixed that earlier for the store, but forgot to fix the return 
statement as well.

Tested x86_64-pc-linux-gnu, applying to trunk.

[-- Attachment #2: 63928.patch --]
[-- Type: text/x-patch, Size: 683 bytes --]

commit dfac7dd2d46c5c0f52f6138c68d7e926d90f99be
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Nov 19 19:03:20 2014 +0000

    	PR c++/63928
    	* constexpr.c (cxx_eval_store_expression): Return init, not *valp.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217790 138bc75d-0d04-0410-961f-82ee72b054a4

diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index d98d9b9..77f5159 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -2554,7 +2554,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
   else if (addr)
     return target;
   else
-    return *valp;
+    return init;
 }
 
 /* Evaluate a ++ or -- expression.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-11-19 19:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 19:09 C++ PATCH for c++/63928 (uninitialized read in constexpr) Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).