** A 'headfail' pattern is a pattern that can only fails in its first ** instruction, which must be a check. */
| 934 | ** instruction, which must be a check. |
| 935 | */ |
| 936 | static int isheadfail (Instruction *p) { |
| 937 | if (!ischeck(p)) return 0; |
| 938 | /* check that other operations cannot fail */ |
| 939 | for (p += sizei(p); p->i.code != IEnd; p += sizei(p)) |
| 940 | if (!isnofail(p)) return 0; |
| 941 | return 1; |
| 942 | } |
| 943 | |
| 944 | |
| 945 | #define checkpattern(L, idx) ((Instruction *)luaL_checkudata(L, idx, PATTERN_T)) |
no test coverage detected