Reorder to prevent crash
authorMiodrag Milanovic <mmicko@gmail.com>
Mon, 31 Aug 2020 10:22:26 +0000 (12:22 +0200)
committerMiodrag Milanovic <mmicko@gmail.com>
Mon, 31 Aug 2020 10:22:26 +0000 (12:22 +0200)
frontends/verific/verific.cc

index 4358d957ddaed67cb8ff8e119cb80b2ace67e6f5..40dca20ba1cd215a7a3c1145aa03f31aec577339 100644 (file)
@@ -2475,7 +2475,7 @@ struct VerificPass : public Pass {
                        goto check_error;
                }
 
-               if (args[argidx] == "-app" && argidx+1 < GetSize(args))
+               if (argidx+1 < GetSize(args) && args[argidx] == "-app")
                {
                        VerificFormalApplications vfa;
                        auto apps = vfa.GetApps();
@@ -2519,7 +2519,7 @@ struct VerificPass : public Pass {
                        goto check_error;
                }
 
-               if (args[argidx] == "-pp" && argidx < GetSize(args))
+               if (argidx < GetSize(args) && args[argidx] == "-pp")
                {
                        const char* filename = nullptr;
                        const char* module = nullptr;
@@ -2561,7 +2561,7 @@ struct VerificPass : public Pass {
                        goto check_error;
                }
 
-               if (args[argidx] == "-template" && argidx < GetSize(args))
+               if (argidx < GetSize(args) && args[argidx] == "-template")
                {
                        if (!(argidx < GetSize(args)))
                                cmd_error(args, argidx, "No template type specified.\n");