[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9631: Make sure not to do operations
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9631: Make sure not to do operations on as_values that are null. |
Date: |
Sun, 19 Oct 2008 18:54:25 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9631
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-10-19 18:54:25 +0800
message:
Make sure not to do operations on as_values that are null.
modified:
libcore/vm/Machine.cpp
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-10-19 07:23:54 +0000
+++ b/libcore/vm/Machine.cpp 2008-10-19 10:54:25 +0000
@@ -1193,7 +1193,7 @@
//TODO: If multiname is runtime also pop namespace and/or name
values.
as_value object_val = pop_stack();
- if(object_val.is_undefined()){
+ if(object_val.is_undefined() || object_val.is_null()){
LOG_DEBUG_AVM("Can't call a method on an undefined
object.");
}
else{
@@ -1201,7 +1201,7 @@
as_object *object = object_val.to_object().get();
as_value property =
object->getMember(a.getGlobalName(),0);
- if(!property.is_undefined()){
+ if(!property.is_undefined() && !property.is_null()){
LOG_DEBUG_AVM("Calling method %s on object
%s",property.toDebugString(),object_val.toDebugString());
as_environment env = as_environment(_vm);
result = call_method(property,&env,object,args);
@@ -1641,7 +1641,7 @@
as_value obj = pop_stack();
- if(!obj.is_undefined()){
+ if(!obj.is_undefined() && !obj.is_null()){
obj.to_object().get()->get_member(name, &val, ns);
}
push_stack(val);
@@ -1665,7 +1665,7 @@
as_value v = pop_stack();
//TODO: If multiname is a runtime mutiname we need to also pop
name and namespace values.
as_value object_asval = pop_stack();
- if(object_asval.is_undefined()){
+ if(object_asval.is_undefined() || object_asval.is_null()){
LOG_DEBUG_AVM("Object is undefined will skip trying to
initialize property.");
}
else{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9631: Make sure not to do operations on as_values that are null.,
Tom Stellard <=