[PATCH] D49578: [libFuzzer] Handle unstable edges by poisoning unstable edges
    Max Moroz via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jul 26 10:01:03 PDT 2018
    
    
  
Dor1s added inline comments.
================
Comment at: lib/fuzzer/FuzzerDriver.cpp:627
+    Options.HandleUnstable =
+        static_cast<HandleUnstableOptions>(Flags.handle_unstable);
   Options.DumpCoverage = Flags.dump_coverage;
----------------
Dor1s wrote:
> morehouse wrote:
> > This cast looks odd since we're comparing int to enum without a cast right before this.  Probably just do implicit cast.
> That's what I though initially, but surprisingly, implicit cast doesn't work in that direction, only from enum to an integer!
```
$ cat test.cpp 
enum Enum {
  One = 1,
  Two = 2
};
int main(int argc, char* argv[]) {
  Enum E = argc;
  return 0;
}
$ clang++ test.cpp 
test.cpp:8:8: error: cannot initialize a variable of type 'Enum' with an lvalue of type 'int'
  Enum E = argc;
       ^   ~~~~
1 error generated.
```
https://reviews.llvm.org/D49578
    
    
More information about the llvm-commits
mailing list