[coreboot-gerrit] New patch to review for coreboot: stddef.h: fix zeroptr's definition

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Wed Apr 13 18:53:35 CEST 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14342

-gerrit

commit bde882711b839fb1a09c78b581275c51b01a1a22
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Wed Apr 13 18:51:12 2016 +0200

    stddef.h: fix zeroptr's definition
    
    As Aaron pointed out, the old definition made the compiler emit two
    memory accesses, to 0 (for derefencing) and then reading at whatever
    address could be read from there.
    
    Change-Id: I5cdd53f5bd2d2397c43f09f3e5fa46be08744b01
    Found-by: Aaron Durbin <adurbin at chromium.org>
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 src/include/stddef.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/stddef.h b/src/include/stddef.h
index 35326ed..d0308d2 100644
--- a/src/include/stddef.h
+++ b/src/include/stddef.h
@@ -39,7 +39,7 @@ typedef unsigned int wint_t;
  * undefined behaviour and do whatever" trickery in compilers.
  * Use when you _really_ need to read32(zeroptr) (ie. read address 0).
  */
-extern void *zeroptr;
+extern char zeroptr[];
 #endif
 
 #endif /* STDDEF_H */



More information about the coreboot-gerrit mailing list