about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2015-02-10 13:12:17 +0100
committerCamille Mougey <commial@gmail.com>2015-02-10 13:12:17 +0100
commit13af8801cc6c45a4b658c80bbd0023765a83369d (patch)
tree2ccc02ad84ec8c40b21e5217ab96288ba02a0873
parent67b513a29f6bfdb3c9a32676a790863e0b6ff521 (diff)
parentd4f805ed81b3c10c6a7ceca0db60f1f6b4e7a63b (diff)
downloadmiasm-13af8801cc6c45a4b658c80bbd0023765a83369d.tar.gz
miasm-13af8801cc6c45a4b658c80bbd0023765a83369d.zip
Merge pull request #56 from serpilliere/x86_fstenv
Arch/X86: fix fsntenv in 64bit
-rw-r--r--miasm2/arch/x86/sem.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/miasm2/arch/x86/sem.py b/miasm2/arch/x86/sem.py
index 6fc2e96b..0acad7ee 100644
--- a/miasm2/arch/x86/sem.py
+++ b/miasm2/arch/x86/sem.py
@@ -2005,6 +2005,9 @@ def fnstenv(ir, instr, a):
                                ])
 
     s = instr.mode
+    # The behaviour in 64bit is identical to 64 bit
+    # This will truncate addresses
+    s = min(32, s)
     ad = ExprMem(a.arg, size=16)
     e.append(ExprAff(ad, float_control))
     ad = ExprMem(a.arg + ExprInt_from(a.arg, s / 8 * 1), size=16)