On 03/13/2015 04:46 PM, srol...@vmware.com wrote:
From: Roland Scheidegger <srol...@vmware.com>

Before this actually ran into an infinite loop printing out "invalid"...
---
  src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp 
b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
index 402d29e..2c4ed21 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
@@ -399,19 +399,23 @@ disassemble(const void* func, llvm::raw_ostream & Out)
              break;
           }
        }
+
+      if (pc >= extent) {
+         Out << "disassembly larger than " << extent << "bytes, aborting\n";
+         break;
+      }
     }

+   Out << "\n";
+   Out.flush();
+
     /*
      * Print GDB command, useful to verify output.
      */
-
     if (0) {
        _debug_printf("disassemble %p %p\n", bytes, bytes + pc);
     }

-   Out << "\n";
-   Out.flush();
-
     return pc;
  }



Reviewed-by: Brian Paul <bri...@vmware.com>

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to