glsl: Don't crash on function names with invalid identifiers.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 12 Nov 2016 19:55:30 +0000 (11:55 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 13 Nov 2016 06:08:15 +0000 (22:08 -0800)
commit151aecabe4be9d45627ef1f6ae6b8d732cea0c28
treeb3f51c9dde83bf63494176716d88352d8c3c4e0e
parent9c676a64273f32c7fb3f2b6973399af1d7f24d46
glsl: Don't crash on function names with invalid identifiers.

Karol Herbst's fuzzing efforts noticed that we would segfault on:

   void bug() {
      2(0);
   }

We just need to bail if the function name isn't an identifier.

Based on a bug fix by Karol Herbst.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97422
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
src/compiler/glsl/ast_function.cpp