The type checker can run out of C-stack when compiling huge mapping constants.
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=6860
Reported by @grubba
Reported in [roxen.com #21295].
Pike 7.8.676.
Thread 9 (LWP 9):
#0 0x00000000004f9948 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294d960, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6924
#1 0x00000000004f99a8 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294d960, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6938
#2 0x00000000004f99a8 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294d9f0, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6938
#3 0x00000000004f99a8 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294da80, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6938
#4 0x00000000004f99a8 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294db10, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6938
#5 0x00000000004f99a8 in new_check_call (fun_name=0x8480e0,
fun_type=0x87a150, args=0x294dba0, argno=0xfffffd7ffa38a5f4, flags=0)
at /tmp/dist/5.2/pike.sol10_x86_64/pike/src/pike_types.c:6938
[...]
(gdb) p (char *)((struct compilation *)(Pike_interpreter.frame_pointer.current_storage)).prog->str
$8 = 0x453bbd0 "# 1 \"-\"\nint n=0,r=1,w=2,user=0,group=1;mixed foo=({0, \"SiteBuilder\", ([3945:w,3419:w,4998:w,4472:w,2894:w,3947:w,265:w,2896:w,792:w,3:w,5001:w,3949:w,1845:w,530:w,267:w,3161:w,3951:w,3425:w,2636:w,237"...
The length of the string being compiled is 6960, and the compiler has recursed ~2000 times before running out of C-stack.