[PATCH] Implement NaCl sandboxing of function calls

Mark Seaborn mseaborn at chromium.org
Tue Mar 11 10:10:41 PDT 2014

  LGTM, thanks

Comment at: lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp:135
@@ -110,3 +134,3 @@
     bool IsSPFirstOperand = isStackPointerFirstOperand(Inst);
     if (IsMemAccess || IsSPFirstOperand) {
       bool MaskBefore = (IsMemAccess
You could check PendingCall here (and for isIndirectJump above and isCall below) and report_fatal_error if it's set, since this would be an invalid instruction in the branch delay slot.  Otherwise you might silently emit a mismatched bundle lock/unlock.

Comment at: lib/Target/Mips/MCTargetDesc/MipsNaClELFStreamer.cpp:152
@@ +151,3 @@
+      // Start the sandboxing sequence by emitting call.
+      EmitBundleLock(true);
+      if (IsIndirectCall) {
Nice simplification from the previous version.


More information about the llvm-commits mailing list