From patchwork Fri May 26 02:12:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 685915 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp677127wrt; Thu, 25 May 2023 19:13:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6BYlh1wdWuVIQ0JyZKEuuUiXx5j+cU00ain603LobBEISTU8ilT6ggtHPlorJX6OAmqC4Y X-Received: by 2002:a05:620a:40d2:b0:75b:23a0:de9a with SMTP id g18-20020a05620a40d200b0075b23a0de9amr883125qko.24.1685067186709; Thu, 25 May 2023 19:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685067186; cv=none; d=google.com; s=arc-20160816; b=rdm0zgYGXxUCXj+KUKQgZ9JWDYHTBRrslf7rpinae/OYv/umzSZfCBPRERKVkt+ELu DWI6jYl12uuNKBFLd7mo26KBk7lPy3mGP9YdJn/wL4u20aMwgl/UumpJxwuP5u8h/lm0 kHIpG6Knqnnnli792p4kcYS6fbelQIlSMCE5ag0cjUHkCu5hUWEJ7h042WdVfSvzcC2h GdNZF3JjPplkv1dHSezEXQOATMykFffL6gXeA5KCG5sf8fGl2xs9neMJpMK+QnQ1uGsI CBjH/kRSJuqjT1xig5NYhLz/RK9bP4n3VDy6o3AgpnPB8OZGwAtjjso6mGf+Tm0fOaSa 285g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MGForFNpx0ZhyGhYah3l6/MGE1/x6CdLWPbICDlT/bs=; b=QdeZ6EtVsONjNn+3Giyv8CLZxSSCR564XQFC8jYtrkTC4dW1jfiDJ+808B7YRwyJ1g 0XHUEbRxNHUhgzmHXGBE182UIAGAbhw30rftWlt3ODXU764BDyDE5yUjd3TOYQCKBttp jUVgrD3vQjlDBom6W0KiGSwhJIU0+cuyp4PjhL6CmZPX694p1Ak1WEqbQo5DnJzi+Qfa bynKVrYtIjI2BKG/RFk67khbmCUNkhBZb6WdFnyehN8tw9zjSODcZ9K0YhpPckA1TAxJ pToLfbeCRrM+6bhrvjDL9G002moIYZJL+ejTkhiAtGNlOIHYQ9I816qyxLU9ik2P31/P xCxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kDDeVxR/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id x1-20020a05620a01e100b007593d311c06si1057314qkn.103.2023.05.25.19.13.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 May 2023 19:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="kDDeVxR/"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2Mwd-00027B-Hf; Thu, 25 May 2023 22:12:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2Mwa-00026w-Rw for qemu-devel@nongnu.org; Thu, 25 May 2023 22:12:40 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2MwU-0004ss-HS for qemu-devel@nongnu.org; Thu, 25 May 2023 22:12:39 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-51452556acdso131154a12.2 for ; Thu, 25 May 2023 19:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685067152; x=1687659152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MGForFNpx0ZhyGhYah3l6/MGE1/x6CdLWPbICDlT/bs=; b=kDDeVxR/Z/lQDoMSHQSRDCLRz4HRJ9XZhbdKHi8+Wsi8ObZ4OVSEIJhZmyAzPBcOmq HNAqWrVFkz8LjTdeSV+eB4ZAfw4cDz53GKGD3a6JLtgMhGhFVU19e3PGq5gEpZeCTjdo 6ICALBAtkBj6Rquf0nckiTo8gyrUJwKKmgceOSfct88YqPqkCpI3tDJvwBqrQG0SEY2L zonXtOjUwiip0Ho6HyhULQA4AhTNAZ/tA5lOlbugI/cEzp9p3r8fTYK7GVNcaOXyPfEB 0OQHu16Mm87eVSt8sZHpiqKx4ufV4ghBWqfaee7ekXHJ5sf2NQCtO5fsJRfsyTVm5dlo NJtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685067152; x=1687659152; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MGForFNpx0ZhyGhYah3l6/MGE1/x6CdLWPbICDlT/bs=; b=jxlmxRlFyBXY8ToUUBAHpQv9uE+5or6Tz/IyunusQlQ3iUWjfYdacnhfgGH0IQKGaF WdojhCujyEuhbYR+XbQLgAi96iTrCAfedbm5PaHXIwCDCufyt+8kzmeqJMqfIsit/ZIV 36OfzZViQHTlujp9ZaDJl0t8tj6w0VEzDluSlaTHOL//ve82UUV6ykq/ClGoEbZHI4ar 1CXJIv11tFDFMuaO01MFogD0MU9J6wJbmdwoOsePJYBu8VUuAL56KOMwl/OTDSIrKfVO b4njSCZwt/HkRkH2vZWQwpIumzHipebdj+UeDccaeFWYL1+luIOkROsplWPA+rch/c+K Xj/A== X-Gm-Message-State: AC+VfDylHb6IkzO9AGqxzcZ935KNFRiZ1fUZoDqzklNL89+Ujo5frZ3E KduvbWBbNN+lcG8gsxT6yT9xPIrhvEMDA58LaCw= X-Received: by 2002:a05:6a20:4322:b0:10c:a627:7ede with SMTP id h34-20020a056a20432200b0010ca6277edemr207135pzk.58.1685067152650; Thu, 25 May 2023 19:12:32 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:7ac5:31cc:3997:3a16]) by smtp.gmail.com with ESMTPSA id oe17-20020a17090b395100b0023a9564763bsm3594086pjb.29.2023.05.25.19.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 19:12:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, pbonzini@redhat.com Subject: [PATCH v2 3/4] decodetree: Diagnose empty pattern group Date: Thu, 25 May 2023 19:12:27 -0700 Message-Id: <20230526021228.1777917-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526021228.1777917-1-richard.henderson@linaro.org> References: <20230526021228.1777917-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Test err_pattern_group_empty.decode failed with exception: Traceback (most recent call last): File "./scripts/decodetree.py", line 1424, in main() File "./scripts/decodetree.py", line 1342, in main toppat.build_tree() File "./scripts/decodetree.py", line 627, in build_tree self.tree = self.__build_tree(self.pats, self.fixedbits, File "./scripts/decodetree.py", line 607, in __build_tree fb = i.fixedbits & innermask TypeError: unsupported operand type(s) for &: 'NoneType' and 'int' Signed-off-by: Richard Henderson --- scripts/decodetree.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index e2640cc79b..e4ef0a03cc 100644 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -506,6 +506,12 @@ def output_code(self, i, extracted, outerbits, outermask): output(ind, '}\n') else: p.output_code(i, extracted, p.fixedbits, p.fixedmask) + + def build_tree(self): + if not self.pats: + error_with_file(self.file, self.lineno, 'empty pattern group') + super().build_tree() + #end IncMultiPattern