From 696c58f9f0f2f8570c2437ad9a0b4b58a92d7346 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 3 Nov 2015 14:11:49 +0100 Subject: [PATCH] Add test case for segfault-on-emu_stop() bug. The following code segfaults: unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_64).emu_stop() Tested under Linux and OS X. --- tests/regress/segfault_on_stop.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 tests/regress/segfault_on_stop.py diff --git a/tests/regress/segfault_on_stop.py b/tests/regress/segfault_on_stop.py new file mode 100755 index 00000000..8d577109 --- /dev/null +++ b/tests/regress/segfault_on_stop.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python + +import regress +import unicorn + + +class SegfaultOnStop(regress.RegressTest): + def test(self): + unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_64).emu_stop() + self.assertTrue(True, "If not reached, then we have a crashing bug.") + +if __name__ == '__main__': + regress.main()