initialize return param subr_num in popSubrNum
also snake_cased popSubrtNum and other surrounding function names
This commit is contained in:
parent
503748d8a8
commit
02ae2591d9
|
@ -147,8 +147,9 @@ struct cs_interp_env_t : interp_env_t<ARG>
|
||||||
return callStack.in_error () || SUPER::in_error ();
|
return callStack.in_error () || SUPER::in_error ();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool popSubrNum (const biased_subrs_t<SUBRS>& biasedSubrs, unsigned int &subr_num)
|
bool pop_subr_num (const biased_subrs_t<SUBRS>& biasedSubrs, unsigned int &subr_num)
|
||||||
{
|
{
|
||||||
|
subr_num = 0;
|
||||||
int n = SUPER::argStack.pop_int ();
|
int n = SUPER::argStack.pop_int ();
|
||||||
n += biasedSubrs.get_bias ();
|
n += biasedSubrs.get_bias ();
|
||||||
if (unlikely ((n < 0) || ((unsigned int)n >= biasedSubrs.get_count ())))
|
if (unlikely ((n < 0) || ((unsigned int)n >= biasedSubrs.get_count ())))
|
||||||
|
@ -158,11 +159,11 @@ struct cs_interp_env_t : interp_env_t<ARG>
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void callSubr (const biased_subrs_t<SUBRS>& biasedSubrs, cs_type_t type)
|
void call_subr (const biased_subrs_t<SUBRS>& biasedSubrs, cs_type_t type)
|
||||||
{
|
{
|
||||||
unsigned int subr_num = 0;
|
unsigned int subr_num = 0;
|
||||||
|
|
||||||
if (unlikely (!popSubrNum (biasedSubrs, subr_num)
|
if (unlikely (!pop_subr_num (biasedSubrs, subr_num)
|
||||||
|| callStack.get_count () >= kMaxCallLimit))
|
|| callStack.get_count () >= kMaxCallLimit))
|
||||||
{
|
{
|
||||||
SUPER::set_error ();
|
SUPER::set_error ();
|
||||||
|
@ -175,7 +176,7 @@ struct cs_interp_env_t : interp_env_t<ARG>
|
||||||
SUPER::str_ref = context.str_ref;
|
SUPER::str_ref = context.str_ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
void returnFromSubr ()
|
void return_from_subr ()
|
||||||
{
|
{
|
||||||
if (unlikely (SUPER::str_ref.in_error ()))
|
if (unlikely (SUPER::str_ref.in_error ()))
|
||||||
SUPER::set_error ();
|
SUPER::set_error ();
|
||||||
|
@ -254,7 +255,7 @@ struct cs_opset_t : opset_t<ARG>
|
||||||
switch (op) {
|
switch (op) {
|
||||||
|
|
||||||
case OpCode_return:
|
case OpCode_return:
|
||||||
env.returnFromSubr ();
|
env.return_from_subr ();
|
||||||
break;
|
break;
|
||||||
case OpCode_endchar:
|
case OpCode_endchar:
|
||||||
OPSET::check_width (op, env, param);
|
OPSET::check_width (op, env, param);
|
||||||
|
@ -267,11 +268,11 @@ struct cs_opset_t : opset_t<ARG>
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpCode_callsubr:
|
case OpCode_callsubr:
|
||||||
env.callSubr (env.localSubrs, CSType_LocalSubr);
|
env.call_subr (env.localSubrs, CSType_LocalSubr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpCode_callgsubr:
|
case OpCode_callgsubr:
|
||||||
env.callSubr (env.globalSubrs, CSType_GlobalSubr);
|
env.call_subr (env.globalSubrs, CSType_GlobalSubr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OpCode_hstem:
|
case OpCode_hstem:
|
||||||
|
|
|
@ -351,7 +351,7 @@ struct cff1_cs_opset_subr_subset_t : cff1_cs_opset_t<cff1_cs_opset_subr_subset_t
|
||||||
case OpCode_return:
|
case OpCode_return:
|
||||||
param.current_parsed_str->add_op (op, env.str_ref);
|
param.current_parsed_str->add_op (op, env.str_ref);
|
||||||
param.current_parsed_str->set_parsed ();
|
param.current_parsed_str->set_parsed ();
|
||||||
env.returnFromSubr ();
|
env.return_from_subr ();
|
||||||
param.set_current_str (env, false);
|
param.set_current_str (env, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ struct cff1_cs_opset_subr_subset_t : cff1_cs_opset_t<cff1_cs_opset_subr_subset_t
|
||||||
cff1_biased_subrs_t& subrs, hb_set_t *closure)
|
cff1_biased_subrs_t& subrs, hb_set_t *closure)
|
||||||
{
|
{
|
||||||
byte_str_ref_t str_ref = env.str_ref;
|
byte_str_ref_t str_ref = env.str_ref;
|
||||||
env.callSubr (subrs, type);
|
env.call_subr (subrs, type);
|
||||||
param.current_parsed_str->add_call_op (op, str_ref, env.context.subr_num);
|
param.current_parsed_str->add_call_op (op, str_ref, env.context.subr_num);
|
||||||
hb_set_add (closure, env.context.subr_num);
|
hb_set_add (closure, env.context.subr_num);
|
||||||
param.set_current_str (env, true);
|
param.set_current_str (env, true);
|
||||||
|
|
|
@ -183,7 +183,7 @@ struct cff2_cs_opset_subr_subset_t : cff2_cs_opset_t<cff2_cs_opset_subr_subset_t
|
||||||
|
|
||||||
case OpCode_return:
|
case OpCode_return:
|
||||||
param.current_parsed_str->set_parsed ();
|
param.current_parsed_str->set_parsed ();
|
||||||
env.returnFromSubr ();
|
env.return_from_subr ();
|
||||||
param.set_current_str (env, false);
|
param.set_current_str (env, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ struct cff2_cs_opset_subr_subset_t : cff2_cs_opset_t<cff2_cs_opset_subr_subset_t
|
||||||
cff2_biased_subrs_t& subrs, hb_set_t *closure)
|
cff2_biased_subrs_t& subrs, hb_set_t *closure)
|
||||||
{
|
{
|
||||||
byte_str_ref_t str_ref = env.str_ref;
|
byte_str_ref_t str_ref = env.str_ref;
|
||||||
env.callSubr (subrs, type);
|
env.call_subr (subrs, type);
|
||||||
param.current_parsed_str->add_call_op (op, str_ref, env.context.subr_num);
|
param.current_parsed_str->add_call_op (op, str_ref, env.context.subr_num);
|
||||||
hb_set_add (closure, env.context.subr_num);
|
hb_set_add (closure, env.context.subr_num);
|
||||||
param.set_current_str (env, true);
|
param.set_current_str (env, true);
|
||||||
|
|
Loading…
Reference in New Issue