From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A4B3A3857B89; Mon, 24 Oct 2022 07:47:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4B3A3857B89 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666597668; bh=jGa+lpS+iL0+RUCb884FXwZ0gGp3LDX+PKfAyFJ03Lg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pu5cL6Gz33mArdFlTCe6LPYr2XSIWrPa0rAZEN3L+s7/8IT3FmdOGfCsHwLpyfv/o i/ep1+if/0XHkLSjgRYkytD5xAAz0RrxD276wHbCKl0k051mMcUAfulnzQwrncRS26 IbHCfTIjufUb4mega/klDUwlHJWBqXLB2dg92oIU= From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/107366] -fanalyzer with -fdiagnostics-format=sarif-file or sarif-stderr Date: Mon, 24 Oct 2022 07:47:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107366 --- Comment #3 from Martin Li=C5=A1ka --- Potential fix: diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc index fc28d160c38..7110db4edd6 100644 --- a/gcc/diagnostic-format-sarif.cc +++ b/gcc/diagnostic-format-sarif.cc @@ -595,7 +595,7 @@ sarif_builder::make_location_object (const diagnostic_e= vent &event) json::object * sarif_builder::maybe_make_physical_location_object (location_t loc) { - if (loc <=3D BUILTINS_LOCATION) + if (loc <=3D BUILTINS_LOCATION || LOCATION_FILE (loc) =3D=3D NULL) return NULL; json::object *phys_loc_obj =3D new json::object ();=