Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Lorensson <lateralusx.github@gmail.com>2016-07-08 09:24:04 +0300
committerGitHub <noreply@github.com>2016-07-08 09:24:04 +0300
commit5aa397ecb7a5b88698b3c22eaf7b3f1ad78bc2c9 (patch)
tree29444f0f0522eeee0bf906861568b06775391042
parente262b595b2f5a7ae30c17d75b829417062ee1846 (diff)
parent87afbc44229e22db3b9784766967d23de8d83283 (diff)
Merge pull request #3247 from lateralusX/jlorenss/win-x64-lmf-exception
Fix crash in mono mini exceptions.exe regression test on win x64.
-rw-r--r--mono/mini/mini-amd64.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c
index 054aa4017ae..932f198a779 100644
--- a/mono/mini/mini-amd64.c
+++ b/mono/mini/mini-amd64.c
@@ -1550,9 +1550,11 @@ mono_arch_allocate_vars (MonoCompile *cfg)
}
cfg->arch.saved_iregs = cfg->used_int_regs;
- if (cfg->method->save_lmf)
- /* Save all callee-saved registers normally, and restore them when unwinding through an LMF */
- cfg->arch.saved_iregs |= (1 << AMD64_RBX) | (1 << AMD64_R12) | (1 << AMD64_R13) | (1 << AMD64_R14) | (1 << AMD64_R15);
+ if (cfg->method->save_lmf) {
+ /* Save all callee-saved registers normally (except RBP, if not already used), and restore them when unwinding through an LMF */
+ guint32 iregs_to_save = AMD64_CALLEE_SAVED_REGS & ~(1<<AMD64_RBP);
+ cfg->arch.saved_iregs |= iregs_to_save;
+ }
if (cfg->arch.omit_fp)
cfg->arch.reg_save_area_offset = offset;