From: Mike Pall Date: Mon, 4 Mar 2013 12:34:01 +0000 (+0100) Subject: Merge branch 'master' into v2.1 X-Git-Tag: v2.1.0-beta1~296 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2edd5cf2887b8132aeed4feb476ba49cdc3fe3b;p=thirdparty%2FLuaJIT.git Merge branch 'master' into v2.1 --- b2edd5cf2887b8132aeed4feb476ba49cdc3fe3b diff --cc src/lib_io.c index e9472ba5,e0c6908f..5369d450 --- a/src/lib_io.c +++ b/src/lib_io.c @@@ -17,8 -17,8 +17,9 @@@ #include "lualib.h" #include "lj_obj.h" + #include "lj_gc.h" #include "lj_err.h" +#include "lj_buf.h" #include "lj_str.h" #include "lj_state.h" #include "lj_ff.h" @@@ -172,9 -174,10 +175,10 @@@ static void io_file_readall(lua_State * static int io_file_readlen(lua_State *L, FILE *fp, MSize m) { if (m) { - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, m); + char *buf = lj_buf_tmp(L, m); MSize n = (MSize)fread(buf, 1, m, fp); setstrV(L, L->top++, lj_str_new(L, buf, (size_t)n)); + lj_gc_check(L); return (n > 0 || m == 0); } else { int c = getc(fp);