diff --git a/core/vm/vm.go b/core/vm/vm.go
index 0d8facbb67772f80f3e6412aa48dffe6fa9d3940..2bd950385deb6654aba46926f86f90da16180ac3 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -71,6 +71,11 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
 		}
 	}
 
+	// Don't bother with the execution if there's no code.
+	if len(code) == 0 {
+		return context.Return(nil), nil
+	}
+
 	var (
 		op       OpCode
 		codehash = crypto.Sha3Hash(code)
@@ -94,11 +99,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
 		}
 	)
 
-	// Don't bother with the execution if there's no code.
-	if len(code) == 0 {
-		return context.Return(nil), nil
-	}
-
 	for {
 		// The base for all big integer arithmetic
 		base := new(big.Int)