[Bf-blender-cvs] [66bb6de] object_nodes: Fix for invalid comparison operator of SocketPair.

Lukas Tönne noreply at git.blender.org
Tue Nov 24 09:44:54 CET 2015


Commit: 66bb6de449310ed850b467af0525589389a0b655
Author: Lukas Tönne
Date:   Sun Nov 22 11:18:35 2015 +0100
Branches: object_nodes
https://developer.blender.org/rB66bb6de449310ed850b467af0525589389a0b655

Fix for invalid comparison operator of SocketPair.

===================================================================

M	source/blender/blenvm/compile/bvm_codegen.cc
M	source/blender/blenvm/compile/bvm_nodegraph.h

===================================================================

diff --git a/source/blender/blenvm/compile/bvm_codegen.cc b/source/blender/blenvm/compile/bvm_codegen.cc
index decf283..a73fb20 100644
--- a/source/blender/blenvm/compile/bvm_codegen.cc
+++ b/source/blender/blenvm/compile/bvm_codegen.cc
@@ -394,6 +394,7 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 		for (int i = 0; i < node.type->inputs.size(); ++i) {
 			const NodeSocket &input = node.type->inputs[i];
 			ConstSocketPair key(&node, input.name);
+			assert(input_index.find(key) == input_index.end());
 			
 			if (node.is_input_constant(i)) {
 				/* value is stored directly in the instructions list,
@@ -418,6 +419,7 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 		for (int i = 0; i < node.type->outputs.size(); ++i) {
 			const NodeSocket &output = node.type->outputs[i];
 			ConstSocketPair key(&node, output.name);
+			assert(output_index.find(key) == output_index.end());
 			
 			output_index[key] = assign_stack_index(output.typedesc);
 			
@@ -439,6 +441,7 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 		for (int i = 0; i < node.type->inputs.size(); ++i) {
 			const NodeSocket &input = node.type->inputs[i];
 			ConstSocketPair key(&node, input.name);
+			assert(input_index.find(key) != input_index.end());
 			
 			if (node.is_input_constant(i)) {
 				Value *value = node.find_input_value(i);
@@ -452,6 +455,7 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 		for (int i = 0; i < node.type->outputs.size(); ++i) {
 			const NodeSocket &output = node.type->outputs[i];
 			ConstSocketPair key(&node, output.name);
+			assert(output_index.find(key) != output_index.end());
 			
 			push_stack_index(output_index[key]);
 		}
@@ -463,6 +467,8 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 			if (node.has_input_link(i)) {
 				ConstSocketPair link_key(node.find_input_link_node(i),
 				                         node.find_input_link_socket(i)->name);
+				assert(output_index.find(link_key) != output_index.end());
+				
 				OpCode release_op = ptr_release_opcode(input.typedesc);
 				
 				if (release_op != OP_NOOP) {
@@ -482,6 +488,7 @@ Function *BVMCompiler::codegen_function(const NodeGraph &graph)
 		
 		if (output.link_node && output.link_socket) {
 			ConstSocketPair link_key(output.link_node, output.link_socket->name);
+			assert(output_index.find(link_key) != output_index.end());
 			
 			rval.stack_offset = output_index[link_key];
 		}
diff --git a/source/blender/blenvm/compile/bvm_nodegraph.h b/source/blender/blenvm/compile/bvm_nodegraph.h
index 7de5318..fbc70c7 100644
--- a/source/blender/blenvm/compile/bvm_nodegraph.h
+++ b/source/blender/blenvm/compile/bvm_nodegraph.h
@@ -122,6 +122,8 @@ struct ConstSocketPair {
 	{
 		if (node < other.node)
 			return true;
+		else if (node > other.node)
+			return false;
 		else
 			return socket < other.socket;
 	}
@@ -152,6 +154,8 @@ struct SocketPair {
 	{
 		if (node < other.node)
 			return true;
+		else if (node > other.node)
+			return false;
 		else
 			return socket < other.socket;
 	}




More information about the Bf-blender-cvs mailing list