Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Feb 2018 03:15:06 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r328837 - stable/11/lib/libpmc
Message-ID:  <201802040315.w143F645014124@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sun Feb  4 03:15:06 2018
New Revision: 328837
URL: https://svnweb.freebsd.org/changeset/base/328837

Log:
  MFC r327911:
  
    Replace the PMC class struct copy with an explicit memcpy()

Modified:
  stable/11/lib/libpmc/libpmc.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libpmc/libpmc.c
==============================================================================
--- stable/11/lib/libpmc/libpmc.c	Sun Feb  4 02:58:12 2018	(r328836)
+++ stable/11/lib/libpmc/libpmc.c	Sun Feb  4 03:15:06 2018	(r328837)
@@ -3268,7 +3268,8 @@ pmc_init(void)
 	cpu_info.pm_npmc    = op_cpu_info.pm_npmc;
 	cpu_info.pm_nclass  = op_cpu_info.pm_nclass;
 	for (n = 0; n < cpu_info.pm_nclass; n++)
-		cpu_info.pm_classes[n] = op_cpu_info.pm_classes[n];
+		memcpy(&cpu_info.pm_classes[n], &op_cpu_info.pm_classes[n],
+		    sizeof(cpu_info.pm_classes[n]));
 
 	pmc_class_table = malloc(PMC_CLASS_TABLE_SIZE *
 	    sizeof(struct pmc_class_descr *));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802040315.w143F645014124>