From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 65EF7385782D for ; Mon, 22 Jan 2024 10:18:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65EF7385782D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 65EF7385782D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705918693; cv=none; b=ZZXGddNdUrVmyxr5bCxLFPIP4BwyjE9INbn9ykjAHHMETwGLQdDN+8+pynmMhNAqOQr+X7sN16FtOvz2vlwoskI/6VsMsebUhMA/tzemzne5N5cRureog1xY7VlL4l8AUjBJogXbTZYY7qOMnqV8jCEqR1QJzSg87np6az/Hrz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705918693; c=relaxed/simple; bh=bw53fabw57kikR2amllnUB9b9AnnoApvMPOVlZdvZV4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=g7jnyPqxVdH4Rwza3Q7Usgu0nIhqNfoIiMvhakgvPXnLdQ3WUMhClZPlul5VqcEkUEzrFD4FUL17LknGfMRuax/NSj1rnbFvK3NOS0cTJIsxUWrrz7oMExQrSl3hVK1BO/Leq6Opjis2FjHqPvuouNy2rLXWqzyGM49+Q1l6K64= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705918688; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=BmdK6SE4M09odub9KQ9t4KzpyEgY7cc0/slqyPOhu0c=; b=IcHAPuw9BcqK0TAQFyHxG2A3DmpaidsJXUHb86H5ZnN8kBTOtJd3v/rpKB80JPOOxILv6p IwHV2rWxm7PPGtHGaaYrc+N9F33ksOFFi2AsiWYkyVtpHnI8WDdmhejGkjmMTmtTuG/wKQ d1JiZAdoASpdwQD9CFUUpYYI3upbm34= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-zJWF_Av_Miuhe4HzBKgSpA-1; Mon, 22 Jan 2024 05:18:06 -0500 X-MC-Unique: zJWF_Av_Miuhe4HzBKgSpA-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-337d988a508so1597930f8f.3 for ; Mon, 22 Jan 2024 02:18:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705918685; x=1706523485; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BmdK6SE4M09odub9KQ9t4KzpyEgY7cc0/slqyPOhu0c=; b=KfSzjHyQJWuF39SHaBL5c8EJ+laHziEWnWhvTLX+Vt46rzad8ZPCLAx43Iaev+1NJ9 a9VjVn5E/0ndU/m8LCPjFzVQVKkIQV2qvUFjY5r90I9fbU6Pw0LUxa5qQAD6RAuIGy2m ni2EaSbGm3NqKbCov//Q4V4zCGIdG08sl/pGOwhnNVUiYiTqy5zjSuJpbSaVAViYYyz+ MEBPr6fIe42rxVAdcyHt8Y8s751CBEvFBo17vBkBKEUG3Zu7+CPKpQFbVqxO14lG5hi+ IJG9IWXvzXlE4GkC6wHXknKVDSeskjASATB689kJvXOUKNSoGAyCnCA1ao16bYuQX5CW 9yTw== X-Gm-Message-State: AOJu0YyqKVIFtUy3tQ+KGiOrSH96BzzWYBxtyIfqt7I/dHztLw9Ug8HR mLdjb21MBO7xRwwdzOpZ6ZOXuF0DwlZSGDX8Ejmn5O9e+0N2JbH6+YReNdARxKcI9iMywMUSVKA vB/ps4Hmkv7yANqjh0SoYaK7JqQk+WiSlr/PT84eb5NtH3PjT6aob4V+IrAw= X-Received: by 2002:a05:6000:1888:b0:339:372e:7721 with SMTP id a8-20020a056000188800b00339372e7721mr1009178wri.24.1705918685390; Mon, 22 Jan 2024 02:18:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGI14ja5eKwp5BttjtQue3HpRz+uq1gI8JQe2sZgNs41oBI0tNuwFLPu6+eTKNBB+4LisEQUQ== X-Received: by 2002:a05:6000:1888:b0:339:372e:7721 with SMTP id a8-20020a056000188800b00339372e7721mr1009168wri.24.1705918685096; Mon, 22 Jan 2024 02:18:05 -0800 (PST) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id y14-20020adff6ce000000b00337d85a5b0fsm9543989wrp.114.2024.01.22.02.18.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 02:18:04 -0800 (PST) From: Andrew Burgess To: jaydeep.patil@imgtec.com, gdb-patches@sourceware.org Cc: vapier@gentoo.org, joseph.faulls@imgtec.com, bhushan.attarde@imgtec.com, jaydeep.patil@imgtec.com Subject: Re: [PATCH v6 1/2] sim: riscv: Fix crash during instruction decoding In-Reply-To: <20240111052822.1576345-2-jaydeep.patil@imgtec.com> References: <20240111052822.1576345-1-jaydeep.patil@imgtec.com> <20240111052822.1576345-2-jaydeep.patil@imgtec.com> Date: Mon, 22 Jan 2024 10:18:03 +0000 Message-ID: <878r4h659g.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: writes: > From: Jaydeep Patil > > The match_never() function has been removed and thus step_once() crashes > during instruction decoding. Fixed it by checking for null pointer before > invoking function attached to match_func member of riscv_opcode structure > --- > sim/riscv/sim-main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thank you for continuing to work on these patches. For patch 1/2: Approved-By: Andrew Burgess Thanks, Andrew > > diff --git a/sim/riscv/sim-main.c b/sim/riscv/sim-main.c > index b04d12c0de1..25dc9b41412 100644 > --- a/sim/riscv/sim-main.c > +++ b/sim/riscv/sim-main.c > @@ -1040,7 +1040,7 @@ void step_once (SIM_CPU *cpu) > for (; op->name; op++) > { > /* Does the opcode match? */ > - if (! op->match_func (op, iw)) > + if (! op->match_func || ! op->match_func (op, iw)) > continue; > /* Is this a pseudo-instruction and may we print it as such? */ > if (op->pinfo & INSN_ALIAS) > -- > 2.25.1