From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D4F7841C5DC for ; Sat, 27 Jun 2020 22:40:43 +0300 (MSK) From: Nikita Pettik Date: Sat, 27 Jun 2020 22:40:40 +0300 Message-Id: <5c03f978f0ceda59adb41fd47a1c502bbf82acbc.1593285714.git.korablev@tarantool.org> Subject: [Tarantool-patches] [PATCH] Fix assignment operation in assertions List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org Cc: v.shpilevoy@tarantool.org Accidentally assignment is used in assertions instead of comparison operation. Let's fix this mistake and use comparison. --- Nothing serious, fortunatelly. Branch: https://github.com/tarantool/tarantool/tree/np/vinyl-fix-asserts src/box/key_def.c | 2 +- src/box/vinyl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/box/key_def.c b/src/box/key_def.c index 18af44961..a03537227 100644 --- a/src/box/key_def.c +++ b/src/box/key_def.c @@ -123,7 +123,7 @@ void key_def_copy(struct key_def *dest, const struct key_def *src) { size_t sz = key_def_copy_size(src); - assert(sz = key_def_copy_size(dest)); + assert(sz == key_def_copy_size(dest)); key_def_copy_impl(dest, src, sz); } diff --git a/src/box/vinyl.c b/src/box/vinyl.c index 6f06f9b11..fd9b7e6c0 100644 --- a/src/box/vinyl.c +++ b/src/box/vinyl.c @@ -3528,7 +3528,7 @@ vinyl_iterator_primary_next(struct iterator *base, struct tuple **ret) { double start_time = ev_monotonic_now(loop()); - assert(base->next = vinyl_iterator_primary_next); + assert(base->next == vinyl_iterator_primary_next); struct vinyl_iterator *it = (struct vinyl_iterator *)base; struct vy_lsm *lsm = it->iterator.lsm; assert(lsm->index_id == 0); @@ -3566,7 +3566,7 @@ vinyl_iterator_secondary_next(struct iterator *base, struct tuple **ret) { double start_time = ev_monotonic_now(loop()); - assert(base->next = vinyl_iterator_secondary_next); + assert(base->next == vinyl_iterator_secondary_next); struct vinyl_iterator *it = (struct vinyl_iterator *)base; struct vy_lsm *lsm = it->iterator.lsm; assert(lsm->index_id > 0); -- 2.17.1