[Dev-luatex] tounicode.w: Stack overflow on Windows 7 (and one possible fix)

Graham Douglas graham.douglas at readytext.co.uk
Tue Sep 3 00:30:29 CEST 2013


Hi All

I just completed "porting" LuaTeX to a native Windows build (Windows 7
Ultimate 64-bit) using Visual Studio. I hit a stack overflow error when
entering the following function:

// #line 456 "tounicode.w"

int write_cid_tounicode(PDF pdf,fo_entry*fo,internal_font_number f)
{

int range_size[65537];
glyph_unicode_entry gtab[65537];

......

Using the guidelines/advice here:

http://www.onlamp.com/pub/a/onlamp/2005/11/23/memory-management-2.html

I changed the above code to:

int write_cid_tounicode(PDF pdf,fo_entry*fo,internal_font_number f)
{

static int range_size[65537];
static glyph _unicode_entry gtab[65537];

And, for sure, no more stack overflows and it now works fine. Not sure
if it's the best fix, but for now it seems to work.

Best
Graham


More information about the dev-luatex mailing list