MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / layerArg

Function layerArg

common/script/progress_api.cpp:48–51  ·  view source on GitHub ↗

A layer index used to be cast straight to size_t and handed to ScriptConsole, whose range check then swallowed a negative one whole: the bar simply never appeared and the script had no way to find out. Checked here instead, so the mistake is reported at the call that made it.

Source from the content-addressed store, hash-verified

46 // bar simply never appeared and the script had no way to find out. Checked
47 // here instead, so the mistake is reported at the call that made it.
48 size_t layerArg(const ScriptArgs& args)
49 {
50 return (size_t)args.numInRange(0, 0, (int)ScriptConsole::MAX_LAYERS - 1);
51 }
52}
53
54void ckpt_progress_begin(struct ParseState* Parser, struct Value* ReturnValue, struct Value** Param, int NumArgs)

Callers 4

ckpt_progress_beginFunction · 0.85
ckpt_progress_setFunction · 0.85
ckpt_progress_labelFunction · 0.85
ckpt_progress_endFunction · 0.85

Calls 1

numInRangeMethod · 0.80

Tested by

no test coverage detected