Fix SEGV while building autoloads for modules in Mac OS X with gcc-4.8.2
authorNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 14 Feb 2014 01:32:42 +0000 (20:32 -0500)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Fri, 14 Feb 2014 01:32:42 +0000 (20:32 -0500)
commitc8551e77dfdec81a9776d5fdfbd281b8e1eb86c5
treef0ac0fc01488e90918ce5b503c2923b30b287db9
parentd0e6dd336c8136eaefc8c6d3b44a59199266305b
Fix SEGV while building autoloads for modules in Mac OS X with gcc-4.8.2

This seems to be a bad interaction between the gcc generated
switch code and with the Mac OS X pthreads stubs, which clear rax
where fun is expected by gcc to reside.

This is the minimal set of changes that fixes the issue, but now I
believe we should comb the codebase for the usage of UNLIKELY and
only keep those that are really useful.

* src/map.c: Refactor the check of NILP(fun) to be outside the
current switch, so there is an additional switch(arity) with just
the NILP(fun) branch of the old one. It was also necessary to
remove the UNLIKELY hint, which was causing the error: Invalid
regexp: "Unmatched ( or \\("

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
src/map.c