Correct checking for well known functions: Properly check for __builtin_ prefix.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 14 Sep 2011 07:20:14 +0000 (09:20 +0200)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 14 Sep 2011 07:20:14 +0000 (09:20 +0200)
The code checked for _..uiltin_ (. being arbitrary chars) or even crashed on strings shorter than 3 chars.

builtins.c

index d15a982..924b14f 100644 (file)
@@ -234,7 +234,7 @@ void adapt_special_functions(function_t *function)
 
        /* Disregard prefix _, __, __x or __builtin_.  */
        if (name[0] == '_') {
-               if (!strncmp(name + 3, "uiltin_", 7))
+               if (!strncmp(name + 1, "_builtin_", 9))
                        name += 10;
                else if (name[1] == '_' && name[2] == 'x')
                        name += 3;