projects
/
platform
/
upstream
/
dotnet
/
runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20ff641
)
defMAC construction up a scope to make it live long enough. (#54702)
author
Jeremy Koritzinsky
<jekoritz@microsoft.com>
Thu, 24 Jun 2021 23:40:40 +0000
(16:40 -0700)
committer
GitHub
<noreply@github.com>
Thu, 24 Jun 2021 23:40:40 +0000
(23:40 +0000)
Fixes #54649
src/coreclr/jit/morph.cpp
patch
|
blob
|
history
diff --git
a/src/coreclr/jit/morph.cpp
b/src/coreclr/jit/morph.cpp
index
6d7f8c7
..
e53c2d9
100644
(file)
--- a/
src/coreclr/jit/morph.cpp
+++ b/
src/coreclr/jit/morph.cpp
@@
-6046,6
+6046,10
@@
GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac)
}
#endif
+ // Create a default MorphAddrContext early so it doesn't go out of scope
+ // before it is used.
+ MorphAddrContext defMAC(MACK_Ind);
+
/* Is this an instance data member? */
if (objRef)
@@
-6136,7
+6140,6
@@
GenTree* Compiler::fgMorphField(GenTree* tree, MorphAddrContext* mac)
// NULL mac means we encounter the GT_FIELD first. This denotes a dereference of the field,
// and thus is equivalent to a MACK_Ind with zero offset.
- MorphAddrContext defMAC(MACK_Ind);
if (mac == nullptr)
{
mac = &defMAC;