From 920081a68f0f1f12de37c3ad0e3727e783b71ac7 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 14 Jun 2023 12:10:39 +0200 Subject: cooker/parse: Error out on 'continue' with value/error tag Signed-off-by: Stefano Brivio --- cooker/parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cooker/parse.c') diff --git a/cooker/parse.c b/cooker/parse.c index 8dc89f9..fb2126e 100644 --- a/cooker/parse.c +++ b/cooker/parse.c @@ -118,11 +118,11 @@ static void handle_return(struct gluten_ctx *g, JSON_Value *value) data = gluten_get_tag(g, tag); jvalue = json_object_get_value(obj, "continue"); - if (json_value_get_type(jvalue) == JSONBoolean) { + if (json_value_get_type(jvalue) == JSONBoolean) cont = json_value_get_boolean(jvalue); - } - if (cont && (v.v_u64 != 0 || error != 0)) - die(" if continue is true, error and value needs to be zero"); + + if (cont && (v.v_u64 != 0 || error != 0 || data.offset != OFFSET_NULL)) + die(" \"continue\" with non-zero value or error code"); debug(" emit return: val=%ld errno=%d cont=%s", v.v_u64, error, cont ? "true" : "false"); -- cgit v1.2.3