| 48 | } |
| 49 | |
| 50 | void ScriptArgs::fail(const char* fmt, ...) const |
| 51 | { |
| 52 | // Formatted here rather than handed to ProgramFail, which knows only |
| 53 | // %s/%d/%c/%t/%f and has no way to prepend the binding name. A stack buffer |
| 54 | // on purpose: this runs on the way out of a failing run, so it must not |
| 55 | // depend on an allocation succeeding. |
| 56 | char message[256]; |
| 57 | va_list args; |
| 58 | va_start(args, fmt); |
| 59 | vsnprintf(message, sizeof(message), fmt, args); |
| 60 | va_end(args); |
| 61 | |
| 62 | ProgramFail(mParser, "%s: %s", mBinding, message); |
| 63 | __builtin_unreachable(); // ProgramFail longjmps; it is just not declared so |
| 64 | } |
| 65 | |
| 66 | struct Value* ScriptArgs::at(int i) const |
| 67 | { |
no outgoing calls
no test coverage detected