Bugfix in "read_verilog -D NAME=VAL" handling
authorClifford Wolf <clifford@clifford.at>
Mon, 28 Nov 2016 13:45:05 +0000 (14:45 +0100)
committerClifford Wolf <clifford@clifford.at>
Mon, 28 Nov 2016 13:45:05 +0000 (14:45 +0100)
frontends/verilog/verilog_frontend.cc

index 3c9ed7ee3e97d3e80f619535fae1ff2b9decaebd..2a1dce3898a5e6abffd4e47c22b616fbb673608e 100644 (file)
@@ -303,10 +303,10 @@ struct VerilogFrontend : public Frontend {
                        }
                        if (arg == "-D" && argidx+1 < args.size()) {
                                std::string name = args[++argidx], value;
-                               size_t equal = name.find('=', 2);
+                               size_t equal = name.find('=');
                                if (equal != std::string::npos) {
-                                       value = arg.substr(equal+1);
-                                       name = arg.substr(0, equal);
+                                       value = name.substr(equal+1);
+                                       name = name.substr(0, equal);
                                }
                                defines_map[name] = value;
                                continue;