Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: tests/common/register_set.c

Issue 10829110: Fix two register leaks in the trusted->untrusted context switch (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Fix comment Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/common/register_set.h ('k') | tests/syscall_return_regs/nacl.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/common/register_set.c
diff --git a/tests/common/register_set.c b/tests/common/register_set.c
index 540ec6a0da64b49f26f219b330c736a5fb7a961e..bec3828bffe7832215f3603ed70ebbc2f4f319fa 100644
--- a/tests/common/register_set.c
+++ b/tests/common/register_set.c
@@ -93,3 +93,30 @@ void RegsAssertEqual(const struct NaClSignalContext *actual,
#undef CHECK_REG
}
+
+void RegsUnsetNonCalleeSavedRegisters(struct NaClSignalContext *regs) {
+#if defined(__i386__)
+ regs->eax = 0;
+ regs->ecx = 0;
+ regs->edx = 0;
+#elif defined(__x86_64__)
+ regs->rax = 0;
+ regs->rcx = 0;
+ regs->rdx = 0;
+ regs->rsi = 0;
+ regs->rdi = 0;
+ regs->r8 = 0;
+ regs->r9 = 0;
+ regs->r10 = 0;
+ regs->r11 = 0;
+#elif defined(__arm__)
+ regs->r0 = 0;
+ regs->r1 = 0;
+ regs->r2 = 0;
+ regs->r3 = 0;
+ regs->r12 = 0;
+ regs->lr = 0;
+#else
+# error Unsupported architecture
+#endif
+}
« no previous file with comments | « tests/common/register_set.h ('k') | tests/syscall_return_regs/nacl.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698