{
"ground_truth": [],
"labels": [
{"rule": "API02-C", "file": "lauxlib.h", "line": 52, "verdict": "FP", "confidence": "high", "reason": "luaL_tolstring returns string+length; size_t *len is an output param, not array size"},
{"rule": "API02-C", "file": "lauxlib.h", "line": 55, "verdict": "FP", "confidence": "high", "reason": "luaL_checklstring uses size_t *l as output param, not array size; standard Lua API pattern"},
{"rule": "API02-C", "file": "lauxlib.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "luaL_optlstring same output-param pattern; no array bound needed"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 58, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array syntax advisory not applicable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 60, "verdict": "FP", "confidence": "high", "reason": "LUALIB_API macro wrappers are single declarations; sqc misidentifies macro expansion as conflicting decls"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 63, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_checkinteger"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 66, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_checkstack"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 67, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_checktype"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 68, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_checkany"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 70, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_newmetatable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 71, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_setmetatable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 75, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_where"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 76, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_error"},
{"rule": "EXP37-C", "file": "lauxlib.h", "line": 76, "verdict": "FP", "confidence": "high", "reason": "luaL_error declared with proper '...' variadic syntax; no header needed for declaration"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 78, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_checkoption"},
{"rule": "ARR02-C", "file": "lauxlib.h", "line": 79, "verdict": "FP", "confidence": "high", "reason": "const char *const lst[] is a function parameter; implicit bounds is correct C for pointer-to-array params"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 82, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_fileresult"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 84, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 84, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 92, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_ref"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 93, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_unref"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 95, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_loadfilex"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 100, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_loadbufferx"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 100, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 101, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 101, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 102, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_loadstring"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 110, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_addgsub"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 115, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_setfuncs"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 119, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_traceback"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 122, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_requiref"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 132, "verdict": "FP", "confidence": "high", "reason": "luaL_newlibtable(L,l): 'l' is always a static const array literal; no side-effecting arg in any call site"},
{"rule": "PRE02-C", "file": "lauxlib.h", "line": 132, "verdict": "FP", "confidence": "high", "reason": "Macro used as function argument expression; operator precedence safe in all call patterns"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 132, "verdict": "FP", "confidence": "high", "reason": "'l' is always passed as a static array identifier; no multiple-eval hazard in practice"},
{"rule": "API03-C", "file": "lauxlib.h", "line": 135, "verdict": "FP", "confidence": "high", "reason": "luaL_newlib expands two sub-macros in fixed order; not a parameter reordering"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 135, "verdict": "FP", "confidence": "high", "reason": "luaL_newlib(L,l): both args are simple identifiers at every call site; no side effects"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 135, "verdict": "FP", "confidence": "high", "reason": "'L' simple variable at all call sites; no multiple-eval hazard"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 147, "verdict": "FP", "confidence": "high", "reason": "luaL_typename(L,i): simple args at all call sites"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 147, "verdict": "FP", "confidence": "high", "reason": "'L' and 'i' simple variables at call sites; no side effects"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 149, "verdict": "FP", "confidence": "high", "reason": "luaL_dofile: args evaluated once each in expansion"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 149, "verdict": "FP", "confidence": "high", "reason": "'L' evaluated once in expansion; no multiple-eval hazard"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 152, "verdict": "FP", "confidence": "high", "reason": "luaL_dostring: args evaluated once each"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 152, "verdict": "FP", "confidence": "high", "reason": "'L' evaluated once in expansion; no multiple-eval hazard"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 157, "verdict": "FP", "confidence": "high", "reason": "luaL_opt: ternary expression; 'f' and 'L' called once in each branch"},
{"rule": "PRE01-C", "file": "lauxlib.h", "line": 157, "verdict": "FP", "confidence": "high", "reason": "'f' used as function call 'f(L,(n))'; parenthesizing 'f' would break syntax"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 157, "verdict": "FP", "confidence": "high", "reason": "'L' used in ternary; only one branch executes; no multiple-eval"},
{"rule": "PRE01-C", "file": "lauxlib.h", "line": 166, "verdict": "FP", "confidence": "high", "reason": "'op' is used as binary operator token (e.g., +); cannot be parenthesized in that context"},
{"rule": "PRE00-C", "file": "lauxlib.h", "line": 201, "verdict": "FP", "confidence": "high", "reason": "luaL_addchar: 'B' evaluated twice but both uses are safe member access on same buffer pointer"},
{"rule": "PRE12-C", "file": "lauxlib.h", "line": 201, "verdict": "FP", "confidence": "high", "reason": "'B' is always a simple buffer pointer variable; no side-effecting call site"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 209, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_buffinit"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 211, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_addlstring"},
{"rule": "API05-C", "file": "lauxlib.h", "line": 211, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 212, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_addstring"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 213, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_addvalue"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 214, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_pushresult"},
{"rule": "DCL40-C", "file": "lauxlib.h", "line": 215, "verdict": "FP", "confidence": "high", "reason": "Same macro-expansion false positive; single declaration of luaL_pushresultsize"},
{"rule": "API03-C", "file": "lauxlib.h", "line": 258, "verdict": "FP", "confidence": "high", "reason": "luaL_checkint is a compat cast macro; parameter order consistent with luaL_checkinteger"},
{"rule": "DCL30-C", "file": "lcorolib.c", "line": 25, "verdict": "FP", "confidence": "high", "reason": "getco returns lua_State* from lua_tothread (Lua stack slot), not address of local stack variable"},
{"rule": "EXP20-C", "file": "lcorolib.c", "line": 35, "verdict": "FP", "confidence": "high", "reason": "lua_checkstack returns int 0/1; !lua_checkstack() is standard Lua idiom per API docs"},
{"rule": "EXP20-C", "file": "lcorolib.c", "line": 42, "verdict": "FP", "confidence": "high", "reason": "Same idiomatic lua_checkstack usage; negation clearly tests for stack overflow failure"},
{"rule": "DCL00-C", "file": "lcorolib.c", "line": 76, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'r' is assigned once and used; const on int local is style, not a defect"},
{"rule": "ARR02-C", "file": "lcorolib.c", "line": 124, "verdict": "FP", "confidence": "high", "reason": "statname[] has implicit bounds from initializer; compiler computes size correctly"},
{"rule": "DCL13-C", "file": "lcorolib.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "Lua API functions cannot declare lua_State* const; this is advisory and inapplicable"},
{"rule": "ARR02-C", "file": "lcorolib.c", "line": 207, "verdict": "FP", "confidence": "high", "reason": "co_funcs[] has implicit bounds from initializer; explicit size would add maintenance burden"},
{"rule": "API00-C", "file": "lcorolib.c", "line": 221, "verdict": "FP", "confidence": "high", "reason": "luaopen_coroutine is called by Lua loader; L guaranteed non-NULL by VM"},
{"rule": "DCL15-C", "file": "lcorolib.c", "line": 221, "verdict": "FP", "confidence": "high", "reason": "luaopen_coroutine is LUAMOD_API; must have external linkage for dynamic loading"},
{"rule": "PRE00-C", "file": "ldump.c", "line": 42, "verdict": "FP", "confidence": "high", "reason": "dumpVector(D,v,n): all three args are simple identifiers at call sites; no side effects"},
{"rule": "PRE12-C", "file": "ldump.c", "line": 42, "verdict": "FP", "confidence": "high", "reason": "'v' evaluated twice (for sizeof and pointer); sizeof is compile-time, no runtime multiple-eval hazard"},
{"rule": "PRE00-C", "file": "ldump.c", "line": 44, "verdict": "FP", "confidence": "high", "reason": "dumpLiteral(D,s): 's' is always a string literal at call sites; sizeof(s) is compile-time"},
{"rule": "PRE02-C", "file": "ldump.c", "line": 44, "verdict": "FP", "confidence": "high", "reason": "dumpLiteral expansion is a void function call statement; parenthesization advisory not applicable"},
{"rule": "PRE12-C", "file": "ldump.c", "line": 44, "verdict": "FP", "confidence": "high", "reason": "'s' is always a string literal; sizeof is compile-time; no runtime side-effect"},
{"rule": "API05-C", "file": "ldump.c", "line": 52, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "INT33-C", "file": "ldump.c", "line": 67, "verdict": "FP", "confidence": "high", "reason": "align is always sizeof(Instruction) or sizeof(int), guaranteed non-zero at all call sites"},
{"rule": "CON03-C", "file": "ldump.c", "line": 69, "verdict": "FP", "confidence": "high", "reason": "paddingContent is a static local used only as a zero-byte source; Lua is single-threaded"},
{"rule": "INT33-C", "file": "ldump.c", "line": 73, "verdict": "FP", "confidence": "high", "reason": "align is sizeof(int) or sizeof(Instruction), guaranteed non-zero"},
{"rule": "INT14-C", "file": "ldump.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "Mixing cast/arithmetic to encode signed integer as unsigned varint; stylistic, no defect"},
{"rule": "INT14-C", "file": "ldump.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "Same as above; l_castS2U cast in arithmetic context is intentional sign-to-unsigned coding"},
{"rule": "MEM10-C", "file": "ldump.c", "line": 144, "verdict": "FP", "confidence": "high", "reason": "Advisory: centralizing NULL checks is a style suggestion; not a defect"},
{"rule": "EXP33-C", "file": "ldump.c", "line": 159, "verdict": "FP", "confidence": "high", "reason": "'size' is initialized by getlstr(ts, size) macro as out-parameter before use"},
{"rule": "ARR01-C", "file": "ldump.c", "line": 173, "verdict": "FP", "confidence": "high", "reason": "sizeof(f->code[0]) where f->code is Instruction*; sizeof on deref gives sizeof(Instruction), correct"},
{"rule": "MSC04-C", "file": "ldump.c", "line": 207, "verdict": "FP", "confidence": "high", "reason": "dumpProtos/dumpFunction mutual recursion is bounded by finite proto tree depth; not an error"},
{"rule": "MSC04-C", "file": "ldump.c", "line": 254, "verdict": "FP", "confidence": "high", "reason": "Same bounded mutual recursion; Lua proto trees have no cycles"},
{"rule": "PRE00-C", "file": "ldump.c", "line": 269, "verdict": "FP", "confidence": "high", "reason": "dumpNumInfo(D,tvar,value): all args simple at call sites; no side-effecting expansions"},
{"rule": "PRE01-C", "file": "ldump.c", "line": 269, "verdict": "FP", "confidence": "high", "reason": "'tvar' is used as a type name (int, Instruction etc.); cannot parenthesize a type"},
{"rule": "PRE01-C", "file": "ldump.c", "line": 269, "verdict": "FP", "confidence": "high", "reason": "'value' used as initializer; safe in context since it's a simple constant expression"},
{"rule": "PRE10-C", "file": "ldump.c", "line": 269, "verdict": "FP", "confidence": "high", "reason": "dumpNumInfo is a brace-enclosed block; called only as standalone statement"},
{"rule": "PRE12-C", "file": "ldump.c", "line": 269, "verdict": "FP", "confidence": "high", "reason": "'D' appears multiple times but is always simple pointer variable; no side effects"},
{"rule": "API00-C", "file": "ldump.c", "line": 288, "verdict": "FP", "confidence": "high", "reason": "luaU_dump is internal API called from lapi.c with validated L from VM"},
{"rule": "API00-C", "file": "ldump.c", "line": 288, "verdict": "FP", "confidence": "high", "reason": "'f' (Proto*) is validated by caller before invoking luaU_dump"},
{"rule": "DCL13-C", "file": "ldump.c", "line": 288, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'data' void* passed to writer callback; const not applicable for opaque user data"},
{"rule": "MEM31-C", "file": "ldump.c", "line": 291, "verdict": "FP", "confidence": "high", "reason": "D.h is a GC-managed Table anchored on Lua stack (sethvalue2s); collected by GC, not freed manually"},
{"rule": "MEM31-C", "file": "ldump.c", "line": 305, "verdict": "FP", "confidence": "high", "reason": "Same: D.h is GC-anchored Table; the stack slot is popped at function end implicitly"},
{"rule": "API00-C", "file": "lfunc.c", "line": 27, "verdict": "FP", "confidence": "high", "reason": "luaF_newCclosure is internal; L is always the live VM state, never NULL"},
{"rule": "DCL00-C", "file": "lfunc.c", "line": 29, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'c' assigned once but it's a local intermediate; const on GC pointer adds no value"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 31, "verdict": "FP", "confidence": "high", "reason": "'c' is a GC-allocated CClosure* via gco2ccl; not a pointer to local stack frame"},
{"rule": "API00-C", "file": "lfunc.c", "line": 35, "verdict": "FP", "confidence": "high", "reason": "Internal function; L guaranteed non-NULL by VM"},
{"rule": "API00-C", "file": "lfunc.c", "line": 35, "verdict": "FP", "confidence": "high", "reason": "nupvals is bounded by MAXUPVAL check in lparser; overflow validation not needed here"},
{"rule": "DCL00-C", "file": "lfunc.c", "line": 37, "verdict": "FP", "confidence": "high", "reason": "Advisory: same as line 29; GC pointer local is idiomatic"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 41, "verdict": "FP", "confidence": "high", "reason": "'c' is GC-allocated LClosure* via gco2lcl; not local stack storage"},
{"rule": "API00-C", "file": "lfunc.c", "line": 48, "verdict": "FP", "confidence": "high", "reason": "Internal function; L non-NULL guaranteed"},
{"rule": "API00-C", "file": "lfunc.c", "line": 48, "verdict": "FP", "confidence": "high", "reason": "Internal function; cl non-NULL guaranteed by caller"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 74, "verdict": "FP", "confidence": "high", "reason": "'uv' is GC-allocated UpVal* via gco2upv; not returning address of local stack variable"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 79, "verdict": "FP", "confidence": "high", "reason": "'uv' is GC-allocated; newupval returns heap object, not local-stack pointer"},
{"rule": "EXP40-C", "file": "lfunc.c", "line": 88, "verdict": "FP", "confidence": "high", "reason": "**pp = &L->openupval is linked-list pointer update, not const circumvention"},
{"rule": "EXP30-C", "file": "lfunc.c", "line": 91, "verdict": "FP", "confidence": "high", "reason": "while ((p = *pp) != NULL && ...) - assignment in condition is sequenced before RHS of &&"},
{"rule": "EXP33-C", "file": "lfunc.c", "line": 91, "verdict": "FP", "confidence": "high", "reason": "'p' is set by while-condition assignment; guaranteed initialized before first loop body use"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 94, "verdict": "FP", "confidence": "high", "reason": "'p' is UpVal** pointer into linked list; not local stack address"},
{"rule": "EXP34-C", "file": "lfunc.c", "line": 95, "verdict": "FP", "confidence": "high", "reason": "'p' is non-NULL (returned early if found) when used at line 95; loop exits before first use"},
{"rule": "MSC04-C", "file": "lfunc.c", "line": 107, "verdict": "FP", "confidence": "high", "reason": "callclosemethod indirect recursion is intentional: Lua allows __close metamethods to call Lua code"},
{"rule": "MSC04-C", "file": "lfunc.c", "line": 127, "verdict": "FP", "confidence": "high", "reason": "checkclosemth indirect recursion bounded by Lua call depth limit"},
{"rule": "MSC04-C", "file": "lfunc.c", "line": 145, "verdict": "FP", "confidence": "high", "reason": "prepcallclosemth indirect recursion: same bounded call-stack mechanism"},
{"rule": "API00-C", "file": "lfunc.c", "line": 172, "verdict": "FP", "confidence": "high", "reason": "luaF_newtbcupval internal; L from live VM, non-NULL"},
{"rule": "MSC04-C", "file": "lfunc.c", "line": 172, "verdict": "FP", "confidence": "high", "reason": "luaF_newtbcupval indirect recursion bounded by Lua call depth and tbc list depth"},
{"rule": "API00-C", "file": "lfunc.c", "line": 186, "verdict": "FP", "confidence": "high", "reason": "luaF_unlinkupval internal; uv guaranteed non-NULL by caller (GC traversal)"},
{"rule": "API00-C", "file": "lfunc.c", "line": 197, "verdict": "FP", "confidence": "high", "reason": "luaF_closeupval internal; L from live VM"},
{"rule": "EXP30-C", "file": "lfunc.c", "line": 199, "verdict": "FP", "confidence": "high", "reason": "while ((uv = L->openupval) != NULL ...) - assignment sequenced before comparison"},
{"rule": "EXP33-C", "file": "lfunc.c", "line": 199, "verdict": "FP", "confidence": "high", "reason": "'uv' set in while-condition; initialized before every loop body access"},
{"rule": "EXP34-C", "file": "lfunc.c", "line": 200, "verdict": "FP", "confidence": "high", "reason": "'uv' is non-NULL by loop condition (checked before entering body)"},
{"rule": "API00-C", "file": "lfunc.c", "line": 230, "verdict": "FP", "confidence": "high", "reason": "luaF_close internal; L from live VM"},
{"rule": "MSC04-C", "file": "lfunc.c", "line": 230, "verdict": "FP", "confidence": "high", "reason": "luaF_close indirect recursion bounded by Lua call depth and tbc list"},
{"rule": "API00-C", "file": "lfunc.c", "line": 243, "verdict": "FP", "confidence": "high", "reason": "luaF_newproto internal; L from live VM"},
{"rule": "DCL30-C", "file": "lfunc.c", "line": 266, "verdict": "FP", "confidence": "high", "reason": "'f' is GC-allocated Proto* via gco2p; not a local-stack pointer"},
{"rule": "API00-C", "file": "lfunc.c", "line": 270, "verdict": "FP", "confidence": "high", "reason": "luaF_protosize internal; p validated by GC traversal caller"},
{"rule": "DCL13-C", "file": "lfunc.c", "line": 270, "verdict": "FP", "confidence": "high", "reason": "Advisory: p not const because function could be called with non-const; stylistic"},
{"rule": "ARR39-C", "file": "lfunc.c", "line": 271, "verdict": "FP", "confidence": "high", "reason": "Expression is integer arithmetic to compute byte count; no pointer arithmetic involved"},
{"rule": "ARR39-C", "file": "lfunc.c", "line": 271, "verdict": "FP", "confidence": "high", "reason": "Same: lu_mem size computation via integer multiply; not scaled pointer offset"},
{"rule": "ARR39-C", "file": "lfunc.c", "line": 271, "verdict": "FP", "confidence": "high", "reason": "Same: computing total size in bytes as integer; sizeof() is correct here"},
{"rule": "INT14-C", "file": "lfunc.c", "line": 271, "verdict": "FP", "confidence": "high", "reason": "size computation uses only arithmetic; no bitwise ops; sqc misidentifies cast as bitwise"},
{"rule": "API00-C", "file": "lfunc.c", "line": 285, "verdict": "FP", "confidence": "high", "reason": "luaF_freeproto internal; L from GC sweep, non-NULL"},
{"rule": "API00-C", "file": "lfunc.c", "line": 285, "verdict": "FP", "confidence": "high", "reason": "luaF_freeproto: f validated by GC before calling; never NULL"},
{"rule": "API00-C", "file": "lfunc.c", "line": 303, "verdict": "FP", "confidence": "high", "reason": "luaF_getlocalname: f is live Proto from VM; non-NULL guaranteed"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 46, "verdict": "FP", "confidence": "high", "reason": "issweepphase(g): 'g' is always a simple global_State pointer; no side effects at call sites"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 46, "verdict": "FP", "confidence": "high", "reason": "'g' evaluated twice but always a simple pointer variable; no multiple-eval hazard"},
{"rule": "API03-C", "file": "lgc.h", "line": 70, "verdict": "FP", "confidence": "high", "reason": "resetbit(x,b) and resetbits(x,m) share consistent (object, bit) parameter convention"},
{"rule": "API03-C", "file": "lgc.h", "line": 71, "verdict": "FP", "confidence": "high", "reason": "testbit(x,b) is consistent with testbits(x,m) in parameter order"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 103, "verdict": "FP", "confidence": "high", "reason": "nw2black(x): 'x' is always a GC object pointer variable; no side effects"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 103, "verdict": "FP", "confidence": "high", "reason": "'x' evaluated twice in check_exp and l_setbit; both uses are same simple pointer"},
{"rule": "PRE02-C", "file": "lgc.h", "line": 106, "verdict": "FP", "confidence": "high", "reason": "luaC_white(g) used only in comparisons; operator precedence safe in context"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 121, "verdict": "FP", "confidence": "high", "reason": "setage(o,a): 'o' is always a simple GC object pointer; no side effects"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 121, "verdict": "FP", "confidence": "high", "reason": "'o' evaluated twice (marked read and write); both are same object; safe"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 204, "verdict": "FP", "confidence": "high", "reason": "setgcparam(g,p,v): 'g' is struct access base; token concat makes parenthesizing impossible"},
{"rule": "PRE05-C", "file": "lgc.h", "line": 204, "verdict": "FP", "confidence": "high", "reason": "'p' is a literal suffix (PAUSE, MUL etc.), not a macro argument; ## is correct usage here"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 205, "verdict": "FP", "confidence": "high", "reason": "applygcparam: same token-concat pattern; 'g' struct access base; FP"},
{"rule": "PRE05-C", "file": "lgc.h", "line": 205, "verdict": "FP", "confidence": "high", "reason": "Same as line 204; literal suffix concatenation is correct"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 229, "verdict": "FP", "confidence": "high", "reason": "condchangemem: only active under HARDMEMTESTS; 'pre'/'pos' are statement args"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 229, "verdict": "FP", "confidence": "high", "reason": "'pre' and 'pos' are statement-level macro arguments; cannot be parenthesized as expressions"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 229, "verdict": "FP", "confidence": "high", "reason": "Same: 'pos' is a statement arg used in void context"},
{"rule": "PRE10-C", "file": "lgc.h", "line": 229, "verdict": "FP", "confidence": "high", "reason": "condchangemem is only used as a statement; brace-block is sufficient"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 229, "verdict": "FP", "confidence": "high", "reason": "'L' in condchangemem is always simple state pointer; no side effects"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "luaC_condGC(L,pre,pos): statement args; L is always simple state pointer"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "'pre' is a statement expression (e.g., (void)0); cannot parenthesize statement"},
{"rule": "PRE01-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "'pos' same: statement expression used in void context"},
{"rule": "PRE02-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "luaC_condGC is used as a statement; outer parens on statement block not required"},
{"rule": "PRE10-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "luaC_condGC used only as statement; brace-block without do-while is accepted pattern"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 233, "verdict": "FP", "confidence": "high", "reason": "'L' always simple state pointer; no side effects"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 241, "verdict": "FP", "confidence": "high", "reason": "luaC_objbarrier: 'p' and 'o' are simple GC pointer args at all call sites"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 241, "verdict": "FP", "confidence": "high", "reason": "'p' evaluated twice in isblack() and obj2gco(); both safe with simple pointer"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 245, "verdict": "FP", "confidence": "high", "reason": "luaC_barrier: 'v' evaluated twice; always a simple TValue or slot argument"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 245, "verdict": "FP", "confidence": "high", "reason": "'v' is iscollectable() and gcvalue() calls; both safe with simple TValue arg"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 248, "verdict": "FP", "confidence": "high", "reason": "luaC_objbarrierback: same analysis as luaC_objbarrier"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 248, "verdict": "FP", "confidence": "high", "reason": "'p' simple GC pointer at all call sites"},
{"rule": "PRE00-C", "file": "lgc.h", "line": 251, "verdict": "FP", "confidence": "high", "reason": "luaC_barrierback: 'v' always simple TValue arg"},
{"rule": "PRE12-C", "file": "lgc.h", "line": 251, "verdict": "FP", "confidence": "high", "reason": "'v' same analysis as luaC_barrier; safe"},
{"rule": "PRE00-C", "file": "lmem.c", "line": 47, "verdict": "FP", "confidence": "high", "reason": "callfrealloc(g,block,os,ns): all args simple variables at call sites; no side effects"},
{"rule": "PRE01-C", "file": "lmem.c", "line": 47, "verdict": "FP", "confidence": "high", "reason": "'g' is struct member access base (g->frealloc); parenthesizing would break the dereference"},
{"rule": "PRE12-C", "file": "lmem.c", "line": 47, "verdict": "FP", "confidence": "high", "reason": "'g' evaluated twice in frealloc deref and ud member; same pointer; no side effect"},
{"rule": "PRE00-C", "file": "lmem.c", "line": 58, "verdict": "FP", "confidence": "high", "reason": "cantryagain(g): 'g' simple global_State pointer; no side effects"},
{"rule": "PRE01-C", "file": "lmem.c", "line": 58, "verdict": "FP", "confidence": "high", "reason": "'g' is struct base for member access; cannot parenthesize in member expression"},
{"rule": "PRE12-C", "file": "lmem.c", "line": 58, "verdict": "FP", "confidence": "high", "reason": "'g' evaluated twice for completestate(g) and g->gcstopem; same pointer, no side effect"},
{"rule": "API05-C", "file": "lmem.c", "line": 69, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "API00-C", "file": "lmem.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "luaM_growaux_ internal; L from VM, always non-NULL"},
{"rule": "API00-C", "file": "lmem.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "block can be NULL (for initial alloc); that's valid for realloc"},
{"rule": "API00-C", "file": "lmem.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "psize pointer validated by design; caller always provides valid int*"},
{"rule": "API00-C", "file": "lmem.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "nelems overflow checked by limit parameter; luaM_growaux_ verifies internally"},
{"rule": "API00-C", "file": "lmem.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "size_elems is sizeof(element_type); always small constant"},
{"rule": "DCL30-C", "file": "lmem.c", "line": 118, "verdict": "FP", "confidence": "high", "reason": "'newblock' is heap pointer from luaM_saferealloc_; not local-stack address"},
{"rule": "API00-C", "file": "lmem.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "luaM_shrinkvector_ internal; L non-NULL from VM"},
{"rule": "API00-C", "file": "lmem.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "block may be NULL for zero-size arrays; handled by realloc semantics"},
{"rule": "API00-C", "file": "lmem.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "size pointer always valid from parser shrink calls"},
{"rule": "API00-C", "file": "lmem.c", "line": 128, "verdict": "FP", "confidence": "high", "reason": "size_elem is sizeof(type); constant; no overflow"},
{"rule": "DCL30-C", "file": "lmem.c", "line": 136, "verdict": "FP", "confidence": "high", "reason": "'newblock' is heap pointer; not a local-stack address"},
{"rule": "API00-C", "file": "lmem.c", "line": 142, "verdict": "FP", "confidence": "high", "reason": "luaM_toobig internal; L from VM, non-NULL"},
{"rule": "MSC04-C", "file": "lmem.c", "line": 142, "verdict": "FP", "confidence": "high", "reason": "luaM_toobig->luaG_runerror path eventually reaches luaM_toobig only for string alloc OOM, which cantryagain prevents via gcstopem"},
{"rule": "MSC37-C", "file": "lmem.c", "line": 142, "verdict": "FP", "confidence": "high", "reason": "luaM_toobig is declared l_noret (noreturn); calls luaG_runerror which is also noreturn"},
{"rule": "API05-C", "file": "lmem.c", "line": 150, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL00-C", "file": "lmem.c", "line": 151, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'g' local intermediate; const on global_State* is style only"},
{"rule": "API05-C", "file": "lmem.c", "line": 162, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL00-C", "file": "lmem.c", "line": 164, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'g' local intermediate; const advisory"},
{"rule": "API05-C", "file": "lmem.c", "line": 176, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "DCL00-C", "file": "lmem.c", "line": 178, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'g' local intermediate"},
{"rule": "DCL30-C", "file": "lmem.c", "line": 188, "verdict": "FP", "confidence": "high", "reason": "'newblock' is heap pointer from luaM_realloc_; not local-stack address"},
{"rule": "API00-C", "file": "lmem.c", "line": 192, "verdict": "FP", "confidence": "high", "reason": "luaM_saferealloc_ internal; L from VM"},
{"rule": "API05-C", "file": "lmem.c", "line": 192, "verdict": "FP", "confidence": "high", "reason": "Lua is not structural-C99; conformant array advisory not applicable"},
{"rule": "MEM30-C", "file": "lmem.c", "line": 196, "verdict": "FP", "confidence": "high", "reason": "luaM_error(L) is called after newblock==NULL; L is not freed, it's the Lua state; sqc misidentifies"},
{"rule": "DCL00-C", "file": "lmem.c", "line": 205, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'g' local intermediate for G(L)"},
{"rule": "PRE00-C", "file": "lparser.h", "line": 74, "verdict": "FP", "confidence": "high", "reason": "vkisvar(k): 'k' always simple enum variable at call sites; no side effects"},
{"rule": "PRE12-C", "file": "lparser.h", "line": 74, "verdict": "FP", "confidence": "high", "reason": "'k' evaluated twice in range comparison; always simple enum variable"},
{"rule": "PRE00-C", "file": "lparser.h", "line": 75, "verdict": "FP", "confidence": "high", "reason": "vkisindexed(k): same as vkisvar; simple enum variable"},
{"rule": "PRE12-C", "file": "lparser.h", "line": 75, "verdict": "FP", "confidence": "high", "reason": "'k' evaluated twice in range comparison; safe with simple variable"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 13, "verdict": "FP", "confidence": "high", "reason": "gnode(t,i): 'i' used as array index; parenthesizing inside [] is not needed for precedence"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 41, "verdict": "FP", "confidence": "high", "reason": "allocsizenode(t): 't' always simple table pointer; no side effects"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 41, "verdict": "FP", "confidence": "high", "reason": "'t' evaluated twice (isdummy test and sizenode); always simple Table pointer"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "luaH_fastgeti: all args simple variables at call sites"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "'t' used as Table* init; parenthesizing 't' would not change semantics"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "'tag' is output lvalue; parenthesizing would break assignment syntax"},
{"rule": "PRE02-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "luaH_fastgeti is a statement-block macro; outer parens not needed"},
{"rule": "PRE10-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "luaH_fastgeti used only as standalone statement; do-while not required"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 49, "verdict": "FP", "confidence": "high", "reason": "'k' evaluated twice (cast and luaH_getint); always simple integer variable"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "luaH_fastseti: all args simple variables at call sites"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "'t' used as Table* init; parenthesizing does not change semantics"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "'hres' is output lvalue; parenthesizing breaks assignment"},
{"rule": "PRE02-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "luaH_fastseti is statement-block macro; outer parens not needed"},
{"rule": "PRE10-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "luaH_fastseti used only as standalone statement"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 57, "verdict": "FP", "confidence": "high", "reason": "'k' evaluated twice; always simple integer variable"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 130, "verdict": "FP", "confidence": "high", "reason": "arr2obj(h,k,val): all args simple variables at call sites"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 130, "verdict": "FP", "confidence": "high", "reason": "'h' evaluated twice for tag and value; always simple Table pointer"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 133, "verdict": "FP", "confidence": "high", "reason": "obj2arr(h,k,val): all args simple at call sites"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 133, "verdict": "FP", "confidence": "high", "reason": "'h' evaluated twice; always simple pointer"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 142, "verdict": "FP", "confidence": "high", "reason": "farr2val: 'res' is output lvalue; no side-effecting arg at call sites"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 142, "verdict": "FP", "confidence": "high", "reason": "'res' evaluated twice (tt_ and value_ writes); always simple TValue pointer"},
{"rule": "PRE00-C", "file": "ltable.h", "line": 145, "verdict": "FP", "confidence": "high", "reason": "fval2arr: all args simple at call sites"},
{"rule": "PRE01-C", "file": "ltable.h", "line": 145, "verdict": "FP", "confidence": "high", "reason": "'tag' is a pointer lvalue (lu_byte*); parenthesizing breaks dereference assignment"},
{"rule": "PRE12-C", "file": "ltable.h", "line": 145, "verdict": "FP", "confidence": "high", "reason": "'val' evaluated twice (tt_ and value_ reads); always simple TValue pointer"},
{"rule": "ARR02-C", "file": "lutf8lib.c", "line": 53, "verdict": "FP", "confidence": "high", "reason": "limits[] static const local array; implicit bounds from initializer is idiomatic C"},
{"rule": "DCL00-C", "file": "lutf8lib.c", "line": 55, "verdict": "FP", "confidence": "high", "reason": "Advisory: 'c' is modified (c <<= 1) in loop; const is not applicable here"},
{"rule": "INT14-C", "file": "lutf8lib.c", "line": 70, "verdict": "FP", "confidence": "high", "reason": "count used in 'count * 5' arithmetic before shift; mixing is intentional UTF-8 bit math"},
{"rule": "INT13-C", "file": "lutf8lib.c", "line": 70, "verdict": "FP", "confidence": "high", "reason": "Shift is '(l_uint32)(...) << (count * 5)': shift applied to unsigned l_uint32, not to signed count"},
{"rule": "ARR00-C", "file": "lutf8lib.c", "line": 81, "verdict": "FP", "confidence": "high", "reason": "s+1 is pointer advance on const char*; not an array with size 1; no OOB"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 94, "verdict": "FP", "confidence": "high", "reason": "'len' initialized by luaL_checklstring(L, 1, &len) as out-parameter before use"},
{"rule": "EXP30-C", "file": "lutf8lib.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "luaL_argcheck macro: --posi is in first arg, not same expression as outer call; sequenced"},
{"rule": "EXP30-C", "file": "lutf8lib.c", "line": 97, "verdict": "FP", "confidence": "high", "reason": "posi decremented once in luaL_argcheck arg; separate from subsequent --posj call"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 123, "verdict": "FP", "confidence": "high", "reason": "'len' initialized by luaL_checklstring(L, 1, &len) before use"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 142, "verdict": "FP", "confidence": "high", "reason": "'code' initialized by utf8_decode(s, &code, !lax) as out-parameter before use"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 185, "verdict": "FP", "confidence": "high", "reason": "'len' initialized by luaL_checklstring(L, 1, &len) before use"},
{"rule": "EXP30-C", "file": "lutf8lib.c", "line": 187, "verdict": "FP", "confidence": "high", "reason": "Same pattern as line 97: --posi in luaL_argcheck arg, properly sequenced"},
{"rule": "EXP30-C", "file": "lutf8lib.c", "line": 187, "verdict": "FP", "confidence": "high", "reason": "posi decremented once in single macro argument; no sequencing issue"},
{"rule": "INT14-C", "file": "lutf8lib.c", "line": 191, "verdict": "FP", "confidence": "high", "reason": "Mixing bitwise iscontp() test with pointer arithmetic posi++ is intentional iteration"},
{"rule": "INT14-C", "file": "lutf8lib.c", "line": 191, "verdict": "FP", "confidence": "high", "reason": "'s + posi' is pointer arithmetic combined with bit test; intentional byte-scan pattern"},
{"rule": "EXP34-C", "file": "lutf8lib.c", "line": 219, "verdict": "FP", "confidence": "high", "reason": "'s' is non-NULL: returned from luaL_checklstring which raises on NULL string"},
{"rule": "STR00-C", "file": "lutf8lib.c", "line": 219, "verdict": "FP", "confidence": "high", "reason": "s[posi] & 0x80 uses bitwise AND; cast to unsigned char done implicitly; sign extension not possible with & 0x80 != 0 check"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 235, "verdict": "FP", "confidence": "high", "reason": "'len' initialized by luaL_checklstring(L, 1, &len) before use"},
{"rule": "EXP33-C", "file": "lutf8lib.c", "line": 246, "verdict": "FP", "confidence": "high", "reason": "'code' initialized by utf8_decode(s+n, &code, strict) as out-parameter before use"},
{"rule": "ARR02-C", "file": "lutf8lib.c", "line": 276, "verdict": "FP", "confidence": "high", "reason": "funcs[] static const array with implicit bounds from initializer; idiomatic luaL_Reg table"},
{"rule": "API00-C", "file": "lutf8lib.c", "line": 288, "verdict": "FP", "confidence": "high", "reason": "luaopen_utf8 called by Lua library loader; L guaranteed non-NULL by VM"},
{"rule": "DCL15-C", "file": "lutf8lib.c", "line": 288, "verdict": "FP", "confidence": "high", "reason": "luaopen_utf8 is LUAMOD_API; must have external linkage for dlopen/loadlib"},
{"rule": "STR30-C", "file": "lutf8lib.c", "line": 291, "verdict": "FP", "confidence": "high", "reason": "lua_setfield takes const char*; UTF8PATT string literal not modified; FP"}
],
"fns": [],
"files_reviewed": [
"lauxlib.h",
"lcorolib.c",
"ldump.c",
"lfunc.c",
"lgc.h",
"lmem.c",
"lparser.h",
"ltable.h",
"lutf8lib.c"
],
"files_clean": [
"lauxlib.h",
"lcorolib.c",
"ldump.c",
"lfunc.c",
"lgc.h",
"lmem.c",
"lparser.h",
"ltable.h",
"lutf8lib.c"
],
"summary": {
"ground_truth": 0,
"tp": 0,
"fp": 246,
"fn": 0
}
}