Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170663761
D59355.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D59355.id.diff
View Options
diff --git a/usr.sbin/pmc/headers.hh b/usr.sbin/pmc/headers.hh
--- a/usr.sbin/pmc/headers.hh
+++ b/usr.sbin/pmc/headers.hh
@@ -74,10 +74,5 @@
char pmc[];
};
-struct pmchdr_cpuidinfo
-{
- uint32_t cpuid[];
-};
-
#endif
diff --git a/usr.sbin/pmc/view.cc b/usr.sbin/pmc/view.cc
--- a/usr.sbin/pmc/view.cc
+++ b/usr.sbin/pmc/view.cc
@@ -177,12 +177,12 @@
pmcview::process_cpuidinfo(int logfd, const pmchdr_infohdr &infohdr)
{
int status;
- pmchdr_cpuidinfo *cpuidinfo;
+ uint32_t *cpuidinfo;
int offset, len;
uint32_t root, maxleaf, count;
len = infohdr.length / 4;
- cpuidinfo = (pmchdr_cpuidinfo *)new uint32_t[len];
+ cpuidinfo = new uint32_t[len];
status = readlog(logfd, cpuidinfo, infohdr.length);
if (status < 0 || status != infohdr.length)
@@ -191,7 +191,7 @@
offset = 0;
while (offset < len) {
- maxleaf = cpuidinfo->cpuid[offset];
+ maxleaf = cpuidinfo[offset];
/*
* In x86 the roots contains the maximum leaf number present.
@@ -200,10 +200,10 @@
count = maxleaf & 0x0000FFFF;
for (uint32_t i = 0; i <= count; i++) {
- cpuid[root + i] = { cpuidinfo->cpuid[4 * i + offset],
- cpuidinfo->cpuid[4 * i + 1 + offset],
- cpuidinfo->cpuid[4 * i + 2 + offset],
- cpuidinfo->cpuid[4 * i + 3 + offset] };
+ cpuid[root + i] = { cpuidinfo[4 * i + offset],
+ cpuidinfo[4 * i + 1 + offset],
+ cpuidinfo[4 * i + 2 + offset],
+ cpuidinfo[4 * i + 3 + offset] };
}
offset += 4 * (count + 1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 6, 9:46 PM (37 m, 38 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38273856
Default Alt Text
D59355.id.diff (1 KB)
Attached To
Mode
D59355: pmc: avoid illegal flexible array member
Attached
Detach File
Event Timeline
Log In to Comment