From eb6ea25e95165fe6467512d759bbcf020e352351 Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Fri, 12 Apr 2013 12:53:42 -0700 Subject: PNaCl ABI checker: Disallow va_arg, varargs functions and varargs calls This doesn't disallow the va_start/va_end/va_copy intrinsics yet; these will get disallowed later when we add whitelisting of intrinsics to the PNaCl ABI checker. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338 TEST=test/NaCl/PNaClABI/*.ll Review URL: https://codereview.chromium.org/13884013 --- lib/Analysis/NaCl/PNaClABIVerifyModule.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Analysis/NaCl/PNaClABIVerifyModule.cpp') diff --git a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp index d98868f53c..857f6a24af 100644 --- a/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp +++ b/lib/Analysis/NaCl/PNaClABIVerifyModule.cpp @@ -145,6 +145,12 @@ bool PNaClABIVerifyModule::runOnModule(Module &M) { PNaClABITypeChecker::getTypeName(PT) << "\n"; } } + // Pointers to varargs function types are not yet disallowed, but + // we do disallow defining or calling functions of varargs types. + if (MI->isVarArg()) { + Reporter->addError() << "Function " << MI->getName() << + " is a variable-argument function (disallowed)\n"; + } if (MI->hasSection()) { Reporter->addError() << "Function " << MI->getName() << -- cgit v1.2.3-70-g09d2