summaryrefslogtreecommitdiff
path: root/databases/tarantool/files/patch-src-box-vy_stmt.c
blob: 6a1c08fdf21e107240dc176bd7e8290c8db4947e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Obtained from:	https://github.com/tarantool/tarantool/commit/518557963250fd30b22005376feb4e0e2a6786a1

--- src/box/vy_stmt.c.orig
+++ src/box/vy_stmt.c
@@ -447,18 +447,19 @@ vy_stmt_new_surrogate_delete_raw(struct tuple_format *format,
 	struct tuple_field *field;
 	struct json_token *parent = &format->fields.root;
 	while (true) {
-		int idx;
-		while ((idx = mp_stack_advance(&stack)) == -1) {
+		struct mp_frame *frame = mp_stack_top(&stack);
+		while (!mp_frame_advance(frame)) {
 			mp_stack_pop(&stack);
 			if (mp_stack_is_empty(&stack))
 				goto finish;
+			frame = mp_stack_top(&stack);
 			parent = parent->parent;
 		}
 		struct json_token token;
-		switch (mp_stack_type(&stack)) {
+		switch (frame->type) {
 		case MP_ARRAY:
 			token.type = JSON_TOKEN_NUM;
-			token.num = idx;
+			token.num = frame->idx;
 			break;
 		case MP_MAP:
 			if (mp_typeof(*src_pos) != MP_STR) {