]> granicus.if.org Git - gc/commitdiff
Prevent abort in register_data_segments for Symbian and Emscripten
authorIvan Maidanski <ivmai@mail.ru>
Tue, 20 Jun 2017 14:05:20 +0000 (17:05 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 2 Jul 2017 08:38:38 +0000 (11:38 +0300)
Issue #163 (bdwgc).

DATASTART is tested to have a non-null value in GC_register_data_segments,
so the macro should not be defined to null even if it is not really
used (null value typically means that the corresponding weak symbol
is not resolved).

* include/private/gcconfig.h [SYMBIAN || __EMSCRIPTEN__] (DATASTART,
DATAEND): Change to a non-null value (ALIGNMENT).

include/private/gcconfig.h

index 24bd0fb6c1e796cd34ebc58fcd919e1a8e88737c..bf4b099ad0a32289daa8275e226a03d6dea0e742 100644 (file)
 #   define OS_TYPE "SYMBIAN"
 #   define CPP_WORDSZ 32
 #   define ALIGNMENT 4
-#   define DATASTART (ptr_t)NULL /* typed null for cppcheck */
-#   define DATAEND (ptr_t)NULL
+#   define DATASTART (ptr_t)ALIGNMENT /* cannot be null */
+#   define DATAEND (ptr_t)ALIGNMENT
 # endif
 
 # ifdef __EMSCRIPTEN__
 #   define OS_TYPE "EMSCRIPTEN"
 #   define CPP_WORDSZ 32
 #   define ALIGNMENT 4
-#   define DATASTART (ptr_t)NULL
-#   define DATAEND (ptr_t)NULL
+#   define DATASTART (ptr_t)ALIGNMENT
+#   define DATAEND (ptr_t)ALIGNMENT
 #   define STACK_NOT_SCANNED
 # endif