aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-06-14 12:10:39 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-06-14 12:10:39 +0200
commit920081a68f0f1f12de37c3ad0e3727e783b71ac7 (patch)
tree809322ea92a8152f52289d1510306b216a2ca3a9
parenta071e4631d18dad45bd247ee2728be50ca33ed39 (diff)
downloadseitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar.gz
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar.bz2
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar.lz
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar.xz
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.tar.zst
seitan-920081a68f0f1f12de37c3ad0e3727e783b71ac7.zip
cooker/parse: Error out on 'continue' with value/error tag
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--cooker/parse.c8
1 files changed, 4 insertions, 4 deletions
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");