summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-11-04 11:20:00 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-11-04 11:20:00 +0800
commit715ab49457f5d797fae8b155f51142674fe0075c (patch)
treec478e75cab592cd0704ba5550ad93cb31f921deb /src
parent644a605940ea619fe3a2cb0401218adf0767fcd0 (diff)
downloadmrust-715ab49457f5d797fae8b155f51142674fe0075c.tar.gz
Trans Enumerate - Fix OOB read caused by vtable lookup
Diffstat (limited to 'src')
-rw-r--r--src/trans/enumerate.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/trans/enumerate.cpp b/src/trans/enumerate.cpp
index 02704a55..b1774041 100644
--- a/src/trans/enumerate.cpp
+++ b/src/trans/enumerate.cpp
@@ -1170,8 +1170,12 @@ namespace {
is_spec = it->second.is_specialisable;
),
(Static,
+ if( pe->item == "#vtable" ) {
+ is_spec = true;
+ break;
+ }
auto it = impl.m_statics.find(pe->item);
- if( it == impl.m_statics.end() && pe->item != "#vtable" ) {
+ if( it == impl.m_statics.end() ) {
DEBUG("Static " << pe->item << " missing in trait " << pe->trait << " for " << *pe->type);
return false;
}