From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.3536.1586827978107152642 for ; Mon, 13 Apr 2020 18:32:58 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: guomin.jiang@intel.com) IronPort-SDR: wrjYjCkSNTdhNxw3xduG1qNO5d5OyQjb77SFEI4jZ9J3UXPBDBr+Gnn6JHkVpLJYpfd3WWeC49 2A0MVgz97PJA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 18:32:57 -0700 IronPort-SDR: VDOy7NFsCrVWaPtIbE/QQv383AgFpmMnsq1Vf6qw2fDYWUAK+PIri69FIbMXipjoHz0HXKVogM I/c7+w0pwj+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,381,1580803200"; d="scan'208";a="426889957" Received: from unknown (HELO guominji-MOBL.ccr.corp.intel.com) ([10.239.158.171]) by orsmga005.jf.intel.com with ESMTP; 13 Apr 2020 18:32:55 -0700 From: "Guomin Jiang" To: devel@edk2.groups.io Cc: kuqin , Michael D Kinney , Sean Brogan , Bret Barkelew Subject: [PATCH v2] UnitTestFrameworkPkg/UnitTestLib: Correct dereferred pointer Date: Tue, 14 Apr 2020 09:32:54 +0800 Message-Id: <20200414013254.2245-1-guomin.jiang@intel.com> X-Mailer: git-send-email 2.25.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: kuqin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2609 SavedState is not sticky, copied pointer update will not change source pointer Cc: Michael D Kinney Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Guomin Jiang --- UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c b/UnitT= estFrameworkPkg/Library/UnitTestLib/UnitTestLib.c index b136992d99..ba4b18568d 100644 --- a/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/UnitTestLib.c @@ -209,7 +209,6 @@ InitUnitTestFramework ( EFI_STATUS Status;=0D UNIT_TEST_FRAMEWORK_HANDLE NewFrameworkHandle;=0D UNIT_TEST_FRAMEWORK *NewFramework;=0D - UNIT_TEST_SAVE_HEADER *SavedState;=0D =0D Status =3D EFI_SUCCESS;=0D NewFramework =3D NULL;=0D @@ -264,8 +263,7 @@ InitUnitTestFramework ( // If there is a persisted context, load it now.=0D //=0D if (DoesCacheExist (NewFrameworkHandle)) {=0D - SavedState =3D (UNIT_TEST_SAVE_HEADER *)NewFramework->SavedState;=0D - Status =3D LoadUnitTestCache (NewFrameworkHandle, &SavedState);=0D + Status =3D LoadUnitTestCache (NewFrameworkHandle, (UNIT_TEST_SAVE_HEA= DER**)(&NewFramework->SavedState));=0D if (EFI_ERROR (Status)) {=0D //=0D // Don't actually report it as an error, but emit a warning.=0D --=20 2.25.1.windows.1