[pypy-svn] r41340 - pypy/dist/pypy/jit/tl

xoraxax at codespeak.net xoraxax at codespeak.net
Mon Mar 26 13:38:54 CEST 2007


Author: xoraxax
Date: Mon Mar 26 13:38:51 2007
New Revision: 41340

Modified:
   pypy/dist/pypy/jit/tl/targettiny2.py
Log:
Do arg checking in targettiny2.py to avoid segfaults.

Modified: pypy/dist/pypy/jit/tl/targettiny2.py
==============================================================================
--- pypy/dist/pypy/jit/tl/targettiny2.py	(original)
+++ pypy/dist/pypy/jit/tl/targettiny2.py	Mon Mar 26 13:38:51 2007
@@ -4,6 +4,10 @@
 
 def entry_point(args):
     highleveljitinfo.sys_executable = args[0]
+    if len(args) < 3:
+        print "Invalid command line arguments."
+        print args[0] + " 'tiny2 program string' arg0 [arg1 [arg2 [...]]]"
+        return 1
     bytecode = [s for s in args[1].split(' ') if s != '']
     args = [tiny2.StrBox(arg) for arg in args[2:]]
     res = tiny2.interpret(bytecode, args)



More information about the Pypy-commit mailing list