summaryrefslogtreecommitdiff
path: root/src/arch/generic
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-11-14 03:53:51 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-11-14 03:53:51 -0500
commit481eb6ae8018d0478c23fda7c5f9f3fa4db8de89 (patch)
treee9b449bc6a2e7b15255c7a3c2d5984e0a99b452c /src/arch/generic
parent9ffe0e7ba67ee194db885b96a7ed3630aed03584 (diff)
downloadgem5-481eb6ae8018d0478c23fda7c5f9f3fa4db8de89.tar.xz
arm: Fixes based on UBSan and static analysis
Another churn to clean up undefined behaviour, mostly ARM, but some parts also touching the generic part of the code base. Most of the fixes are simply ensuring that proper intialisation. One of the more subtle changes is the return type of the sign-extension, which is changed to uint64_t. This is to avoid shifting negative values (undefined behaviour) in the ISA code.
Diffstat (limited to 'src/arch/generic')
-rw-r--r--src/arch/generic/types.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/generic/types.hh b/src/arch/generic/types.hh
index 931c07134..0381e9953 100644
--- a/src/arch/generic/types.hh
+++ b/src/arch/generic/types.hh
@@ -47,8 +47,8 @@ class PCStateBase
Addr _pc;
Addr _npc;
- PCStateBase() {}
- PCStateBase(Addr val) { set(val); }
+ PCStateBase() : _pc(0), _npc(0) {}
+ PCStateBase(Addr val) : _pc(0), _npc(0) { set(val); }
public:
/**
@@ -206,8 +206,8 @@ class UPCState : public SimplePCState<MachInst>
nupc(1);
}
- UPCState() {}
- UPCState(Addr val) { set(val); }
+ UPCState() : _upc(0), _nupc(0) {}
+ UPCState(Addr val) : _upc(0), _nupc(0) { set(val); }
bool
branching() const