diff --git a/dlang.http/dlang/src/vm.cpp b/dlang.http/dlang/src/vm.cpp index 6e223c2..39b1919 100644 --- a/dlang.http/dlang/src/vm.cpp +++ b/dlang.http/dlang/src/vm.cpp @@ -200,13 +200,25 @@ void DlangVM::Execute(ByteCodeArray bytecode) auto b = stack.pop(); auto a = stack.pop(); - if (a.type != StackValueType::Int || b.type != StackValueType::Int) - throw std::runtime_error("LESS_THAN Operation error, not all variables are integer!"); + if (a.type == StackValueType::Int && b.type == StackValueType::Int) + { + stack.push(StackValue(StackValueType::Bool, + std::get(a.data) == + std::get(b.data) + )); + continue; + } - stack.push(StackValue(StackValueType::Bool, - std::get(a.data) == - std::get(b.data) - )); + if (a.type == StackValueType::String && b.type == StackValueType::String) + { + stack.push(StackValue(StackValueType::Bool, + std::get(a.data) == + std::get(b.data) + )); + continue; + } + + throw std::runtime_error("COMPARE Operation error, in compatible variables!"); } break; case Opcodes::GTE: { @@ -284,6 +296,8 @@ void DlangVM::Execute(ByteCodeArray bytecode) if (a.type == StackValueType::Int && b.type == StackValueType::Int) { result.data = (std::get(a.data) != std::get(b.data)); + } else if(a.type == StackValueType::String && b.type == StackValueType::String) { + result.data = (std::get(a.data) != std::get(b.data)); } stack.push(result); diff --git a/dlang.http/dlang/vm.hpp b/dlang.http/dlang/vm.hpp index 381999f..97ce77d 100644 --- a/dlang.http/dlang/vm.hpp +++ b/dlang.http/dlang/vm.hpp @@ -12,7 +12,7 @@ inline ModuleManager* pluginManager = nullptr; #define DEBUG_MODE 0 -#define VERSION "v1.0.38" +#define VERSION "v1.0.39" using ByteCodeArray = std::vector;