Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into error-improvements
  • Loading branch information
lysnikolaou committed May 17, 2020
commit c840fcae78be4fe6315a1ce5a00e278b08da15a6
16 changes: 11 additions & 5 deletions Parser/pegen/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -17052,7 +17052,8 @@ _loop0_126_rule(Parser *p)
int _start_mark = p->mark;
void **_children = PyMem_Malloc(sizeof(void *));
if (!_children) {
PyErr_Format(PyExc_MemoryError, "Parser out of memory");
p->error_indicator = 1;
PyErr_NoMemory();
return NULL;
}
ssize_t _children_capacity = 1;
Expand All @@ -17066,11 +17067,15 @@ _loop0_126_rule(Parser *p)
_res = star_named_expressions_var;
if (_n == _children_capacity) {
_children_capacity *= 2;
_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
if (!_children) {
PyErr_Format(PyExc_MemoryError, "realloc None");
void **_new_children = PyMem_Realloc(_children, _children_capacity*sizeof(void *));
if (!_new_children) {
p->error_indicator = 1;
PyErr_NoMemory();
return NULL;
}
else {
_children = _new_children;
}
}
_children[_n++] = _res;
_mark = p->mark;
Expand All @@ -17079,8 +17084,9 @@ _loop0_126_rule(Parser *p)
}
asdl_seq *_seq = _Py_asdl_seq_new(_n, p->arena);
if (!_seq) {
PyErr_Format(PyExc_MemoryError, "asdl_seq_new _loop0_126");
PyMem_Free(_children);
p->error_indicator = 1;
PyErr_NoMemory();
return NULL;
}
for (int i = 0; i < _n; i++) asdl_seq_SET(_seq, i, _children[i]);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.