aboutsummaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2015-11-03 23:38:03 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2015-11-03 23:38:03 +0800
commitcccf71f117f6acd02726d8d72702bdc8cc35d86d (patch)
tree595978944ddb4ce6e0ccb0c94fcdab252e4fce63 /src/core
parentf68cc9034a576b6f91cf0db0344ece971944c973 (diff)
downloadbullet-lab-remix-cccf71f117f6acd02726d8d72702bdc8cc35d86d.tar.xz
Avoid incomplete data transfer.
Fix loop mark stack underflowing.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/laser.hpp4
-rw-r--r--src/core/vmrunner.cpp8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/core/laser.hpp b/src/core/laser.hpp
new file mode 100644
index 0000000..2fac21c
--- /dev/null
+++ b/src/core/laser.hpp
@@ -0,0 +1,4 @@
+#ifndef LASER_H
+#define LASER_H
+
+#endif // LASER_H
diff --git a/src/core/vmrunner.cpp b/src/core/vmrunner.cpp
index 43fe1f5..1767cfa 100644
--- a/src/core/vmrunner.cpp
+++ b/src/core/vmrunner.cpp
@@ -18,11 +18,11 @@ Idata& blrScriptVM::fetchData(SPara para,bool forcerw)
{
case 0:
if(forcerw)throw;
- cret.i()=para.data.i;cret.type=0;
+ cret.D.d=para.data.d;cret.type=0;
return cret;
case 1:
if(forcerw)throw;
- cret.r()=para.data.r;cret.type=1;
+ cret.D.d=para.data.d;cret.type=1;
return cret;
case 2:
return ir[para.data.i];
@@ -274,7 +274,7 @@ void blrScriptVM::vmRunFunction(const char *fncnym)
if(fetchData(inst[cur].para1).nez())
{
lpjmp[lops]=cur;
- lppos[lops++]=fetchData(inst[cur].para2);
+ lppos[lops++]=fetchData(inst[cur].para2).i();
}
else cur=fetchData(inst[cur].para2).i()+1,jmp=1;
break;
@@ -287,7 +287,7 @@ void blrScriptVM::vmRunFunction(const char *fncnym)
cur=lppos[--lops],jmp=1;
break;
}
- if(cur==lppos[lops-1])cur=lpjmp[--lops],jmp=1;
+ if(lops&&cur==lppos[lops-1])cur=lpjmp[--lops],jmp=1;
if(!jmp)++cur;
}
}