From 92cc779caf66bc470fe6c669d755f6d99da55378 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Tue, 11 Jun 2024 09:13:25 +0200 Subject: [PATCH] Make chan_pop() error more clear Fixes: https://pm.bsc.es/gitlab/rarias/ovni/-/issues/188 --- src/emu/chan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/emu/chan.c b/src/emu/chan.c index 15e8295..4832bef 100644 --- a/src/emu/chan.c +++ b/src/emu/chan.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC) +/* Copyright (c) 2021-2024 Barcelona Supercomputing Center (BSC) * SPDX-License-Identifier: GPL-3.0-or-later */ #include "chan.h" @@ -155,7 +155,7 @@ chan_push(struct chan *chan, struct value value) /** Remove one value from the stack. Fails if the top of the stack * doesn't match the expected value. * - * @param expected The expected value on the top of the stack. + * @param evalue The expected value on the top of the stack. * * @return On success returns 0, otherwise returns -1. */ @@ -182,10 +182,10 @@ chan_pop(struct chan *chan, struct value evalue) struct value *value = &stack->values[stack->n - 1]; if (!value_is_equal(value, &evalue)) { - err("%s: unexpected value %s (expected %s)", + err("%s: expected value %s different from top of stack %s", chan->name, - value_str(*value), - value_str(evalue)); + value_str(evalue), + value_str(*value)); return -1; }