diff options
author | Sergey Andreenko <seandree@microsoft.com> | 2017-08-31 18:31:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 18:31:12 -0700 |
commit | 8a036ea897835e72ba4f0c0fbe4fa2198b850e1f (patch) | |
tree | c175e568f2f29a62e48f8c337c581de8372f1ef1 /src/ToolBox | |
parent | 559c603f2e9d2d89cca6c7c6731f720a7935e369 (diff) | |
download | coreclr-8a036ea897835e72ba4f0c0fbe4fa2198b850e1f.tar.gz coreclr-8a036ea897835e72ba4f0c0fbe4fa2198b850e1f.tar.bz2 coreclr-8a036ea897835e72ba4f0c0fbe4fa2198b850e1f.zip |
spmi: fix prevEnviroment delete statement. (#13729)
Diffstat (limited to 'src/ToolBox')
-rw-r--r-- | src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp index eb3b18927a..82a7985ce5 100644 --- a/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp +++ b/src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp @@ -6095,11 +6095,18 @@ bool MethodContext::wasEnviromentChanged() } if (changed) { - if (prevEnviroment == nullptr) + if (prevEnviroment != nullptr) { delete prevEnviroment; } - prevEnviroment = new DenseLightWeightMap<Agnostic_Environment>(*Environment); + if (Environment != nullptr) + { + prevEnviroment = new DenseLightWeightMap<Agnostic_Environment>(*Environment); + } + else + { + prevEnviroment = nullptr; + } return true; } return false; |