cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

return_directly.cocci (233B)


      1// replace 'R = X; return R;' with 'return X;'
      2@@
      3identifier VAR;
      4expression E;
      5type T;
      6identifier F;
      7@@
      8 T F(...)
      9 {
     10     ...
     11-    T VAR;
     12     ... when != VAR
     13
     14-    VAR =
     15+    return
     16     E;
     17-    return VAR;
     18     ... when != VAR
     19 }