Skip to content

Commit 6305119

Browse files
twosenikic
authored andcommitted
Prefix error_code with underscore in FastZPP implementation
To avoid conflicts with parameter names.
1 parent bd1d2c7 commit 6305119

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

Zend/zend_API.h

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
737737
char *_error = NULL; \
738738
zend_bool _dummy; \
739739
zend_bool _optional = 0; \
740-
int error_code = ZPP_ERROR_OK; \
740+
int _error_code = ZPP_ERROR_OK; \
741741
((void)_i); \
742742
((void)_real_arg); \
743743
((void)_arg); \
@@ -753,7 +753,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
753753
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
754754
zend_wrong_parameters_count_error(_flags & ZEND_PARSE_PARAMS_THROW, _num_args, _min_num_args, _max_num_args); \
755755
} \
756-
error_code = ZPP_ERROR_FAILURE; \
756+
_error_code = ZPP_ERROR_FAILURE; \
757757
break; \
758758
} \
759759
_i = 0; \
@@ -764,13 +764,13 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
764764

765765
#define ZEND_PARSE_PARAMETERS_END_EX(failure) \
766766
} while (0); \
767-
if (UNEXPECTED(error_code != ZPP_ERROR_OK)) { \
767+
if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \
768768
if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \
769-
if (error_code == ZPP_ERROR_WRONG_CALLBACK) { \
769+
if (_error_code == ZPP_ERROR_WRONG_CALLBACK) { \
770770
zend_wrong_callback_error(_flags & ZEND_PARSE_PARAMS_THROW, E_WARNING, _i, _error); \
771-
} else if (error_code == ZPP_ERROR_WRONG_CLASS) { \
771+
} else if (_error_code == ZPP_ERROR_WRONG_CLASS) { \
772772
zend_wrong_parameter_class_error(_flags & ZEND_PARSE_PARAMS_THROW, _i, _error, _arg); \
773-
} else if (error_code == ZPP_ERROR_WRONG_ARG) { \
773+
} else if (_error_code == ZPP_ERROR_WRONG_ARG) { \
774774
zend_wrong_parameter_type_error(_flags & ZEND_PARSE_PARAMS_THROW, _i, _expected_type, _arg); \
775775
} \
776776
} \
@@ -806,7 +806,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
806806
Z_PARAM_PROLOGUE(deref, separate); \
807807
if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 0))) { \
808808
_expected_type = Z_EXPECTED_ARRAY; \
809-
error_code = ZPP_ERROR_WRONG_ARG; \
809+
_error_code = ZPP_ERROR_WRONG_ARG; \
810810
break; \
811811
}
812812

@@ -821,7 +821,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
821821
Z_PARAM_PROLOGUE(deref, separate); \
822822
if (UNEXPECTED(!zend_parse_arg_array(_arg, &dest, check_null, 1))) { \
823823
_expected_type = Z_EXPECTED_ARRAY; \
824-
error_code = ZPP_ERROR_WRONG_ARG; \
824+
_error_code = ZPP_ERROR_WRONG_ARG; \
825825
break; \
826826
}
827827

@@ -836,7 +836,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
836836
Z_PARAM_PROLOGUE(deref, separate); \
837837
if (UNEXPECTED(!zend_parse_arg_bool(_arg, &dest, &is_null, check_null))) { \
838838
_expected_type = Z_EXPECTED_BOOL; \
839-
error_code = ZPP_ERROR_WRONG_ARG; \
839+
_error_code = ZPP_ERROR_WRONG_ARG; \
840840
break; \
841841
}
842842

@@ -850,7 +850,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
850850
#define Z_PARAM_CLASS_EX2(dest, check_null, deref, separate) \
851851
Z_PARAM_PROLOGUE(deref, separate); \
852852
if (UNEXPECTED(!zend_parse_arg_class(_arg, &dest, _i, check_null))) { \
853-
error_code = ZPP_ERROR_FAILURE; \
853+
_error_code = ZPP_ERROR_FAILURE; \
854854
break; \
855855
}
856856

@@ -865,7 +865,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
865865
Z_PARAM_PROLOGUE(deref, separate); \
866866
if (UNEXPECTED(!zend_parse_arg_double(_arg, &dest, &is_null, check_null))) { \
867867
_expected_type = Z_EXPECTED_DOUBLE; \
868-
error_code = ZPP_ERROR_WRONG_ARG; \
868+
_error_code = ZPP_ERROR_WRONG_ARG; \
869869
break; \
870870
}
871871

@@ -881,10 +881,10 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
881881
if (UNEXPECTED(!zend_parse_arg_func(_arg, &dest_fci, &dest_fcc, check_null, &_error))) { \
882882
if (!_error) { \
883883
_expected_type = Z_EXPECTED_FUNC; \
884-
error_code = ZPP_ERROR_WRONG_ARG; \
884+
_error_code = ZPP_ERROR_WRONG_ARG; \
885885
break; \
886886
} else { \
887-
error_code = ZPP_ERROR_WRONG_CALLBACK; \
887+
_error_code = ZPP_ERROR_WRONG_CALLBACK; \
888888
break; \
889889
} \
890890
} else if (UNEXPECTED(_error != NULL)) { \
@@ -902,7 +902,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
902902
Z_PARAM_PROLOGUE(deref, separate); \
903903
if (UNEXPECTED(!zend_parse_arg_array_ht(_arg, &dest, check_null, 0, separate))) { \
904904
_expected_type = Z_EXPECTED_ARRAY; \
905-
error_code = ZPP_ERROR_WRONG_ARG; \
905+
_error_code = ZPP_ERROR_WRONG_ARG; \
906906
break; \
907907
}
908908

@@ -917,7 +917,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
917917
Z_PARAM_PROLOGUE(deref, separate); \
918918
if (UNEXPECTED(!zend_parse_arg_array_ht(_arg, &dest, check_null, 1, separate))) { \
919919
_expected_type = Z_EXPECTED_ARRAY; \
920-
error_code = ZPP_ERROR_WRONG_ARG; \
920+
_error_code = ZPP_ERROR_WRONG_ARG; \
921921
break; \
922922
}
923923

@@ -932,7 +932,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
932932
Z_PARAM_PROLOGUE(deref, separate); \
933933
if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, 0))) { \
934934
_expected_type = Z_EXPECTED_LONG; \
935-
error_code = ZPP_ERROR_WRONG_ARG; \
935+
_error_code = ZPP_ERROR_WRONG_ARG; \
936936
break; \
937937
}
938938

@@ -947,7 +947,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
947947
Z_PARAM_PROLOGUE(deref, separate); \
948948
if (UNEXPECTED(!zend_parse_arg_long(_arg, &dest, &is_null, check_null, 1))) { \
949949
_expected_type = Z_EXPECTED_LONG; \
950-
error_code = ZPP_ERROR_WRONG_ARG; \
950+
_error_code = ZPP_ERROR_WRONG_ARG; \
951951
break; \
952952
}
953953

@@ -962,7 +962,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
962962
Z_PARAM_PROLOGUE(deref, separate); \
963963
if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, NULL, check_null))) { \
964964
_expected_type = Z_EXPECTED_OBJECT; \
965-
error_code = ZPP_ERROR_WRONG_ARG; \
965+
_error_code = ZPP_ERROR_WRONG_ARG; \
966966
break; \
967967
}
968968

@@ -978,11 +978,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
978978
if (UNEXPECTED(!zend_parse_arg_object(_arg, &dest, _ce, check_null))) { \
979979
if (_ce) { \
980980
_error = ZSTR_VAL((_ce)->name); \
981-
error_code = ZPP_ERROR_WRONG_CLASS; \
981+
_error_code = ZPP_ERROR_WRONG_CLASS; \
982982
break; \
983983
} else { \
984984
_expected_type = Z_EXPECTED_OBJECT; \
985-
error_code = ZPP_ERROR_WRONG_ARG; \
985+
_error_code = ZPP_ERROR_WRONG_ARG; \
986986
break; \
987987
} \
988988
}
@@ -998,7 +998,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
998998
Z_PARAM_PROLOGUE(deref, separate); \
999999
if (UNEXPECTED(!zend_parse_arg_path(_arg, &dest, &dest_len, check_null))) { \
10001000
_expected_type = Z_EXPECTED_PATH; \
1001-
error_code = ZPP_ERROR_WRONG_ARG; \
1001+
_error_code = ZPP_ERROR_WRONG_ARG; \
10021002
break; \
10031003
}
10041004

@@ -1013,7 +1013,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
10131013
Z_PARAM_PROLOGUE(deref, separate); \
10141014
if (UNEXPECTED(!zend_parse_arg_path_str(_arg, &dest, check_null))) { \
10151015
_expected_type = Z_EXPECTED_PATH; \
1016-
error_code = ZPP_ERROR_WRONG_ARG; \
1016+
_error_code = ZPP_ERROR_WRONG_ARG; \
10171017
break; \
10181018
}
10191019

@@ -1028,7 +1028,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
10281028
Z_PARAM_PROLOGUE(deref, separate); \
10291029
if (UNEXPECTED(!zend_parse_arg_resource(_arg, &dest, check_null))) { \
10301030
_expected_type = Z_EXPECTED_RESOURCE; \
1031-
error_code = ZPP_ERROR_WRONG_ARG; \
1031+
_error_code = ZPP_ERROR_WRONG_ARG; \
10321032
break; \
10331033
}
10341034

@@ -1043,7 +1043,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
10431043
Z_PARAM_PROLOGUE(deref, separate); \
10441044
if (UNEXPECTED(!zend_parse_arg_string(_arg, &dest, &dest_len, check_null))) { \
10451045
_expected_type = Z_EXPECTED_STRING; \
1046-
error_code = ZPP_ERROR_WRONG_ARG; \
1046+
_error_code = ZPP_ERROR_WRONG_ARG; \
10471047
break; \
10481048
}
10491049

@@ -1058,7 +1058,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(zend_bool throw_
10581058
Z_PARAM_PROLOGUE(deref, separate); \
10591059
if (UNEXPECTED(!zend_parse_arg_str(_arg, &dest, check_null))) { \
10601060
_expected_type = Z_EXPECTED_STRING; \
1061-
error_code = ZPP_ERROR_WRONG_ARG; \
1061+
_error_code = ZPP_ERROR_WRONG_ARG; \
10621062
break; \
10631063
}
10641064

0 commit comments

Comments
 (0)