Make sure that statements such as: strcpy (dst, "/gnu/store/…"); do not result in chunked /gnu/store strings that are undetectable by Guix's GC and its grafting code. See . --- gcc-5.3.0/gcc/builtins.c 2016-10-18 10:50:46.080616285 +0200 +++ gcc-5.3.0/gcc/builtins.c 2016-11-09 15:26:43.693042737 +0100 @@ -3192,6 +3192,42 @@ determine_block_size (tree len, rtx len_ GET_MODE_MASK (GET_MODE (len_rtx))); } +/* Return true if STR contains the string "/gnu/store". */ + +static bool +store_reference_p (tree str) +{ + if (TREE_CODE (str) == ADDR_EXPR) + str = TREE_OPERAND (str, 0); + + if (TREE_CODE (str) != STRING_CST) + return false; + + int len; + const char *store; + + store = getenv ("NIX_STORE") ? getenv ("NIX_STORE") : "/gnu/store"; + len = strlen (store); + + /* Size of the hash part of store file names, including leading slash and + trailing hyphen. */ + const int
aboutsummaryrefslogtreecommitdiff
path: root