summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-04-06 05:36:18 +0200
committerGitHub <noreply@github.com>2019-04-06 05:36:18 +0200
commit520e4e5d4b9c332ecee03ce15ca85312b6e43a99 (patch)
tree3b9f68892843d9884a2bdbb82511583e0be1607e /src
parentMerge pull request #2343 from lioncash/todo (diff)
parentgl_shader_decompiler: Return early when an operation is invalid (diff)
downloadyuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar.gz
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar.bz2
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar.lz
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar.xz
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.tar.zst
yuzu-520e4e5d4b9c332ecee03ce15ca85312b6e43a99.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 3222028d5..a1a51f226 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -426,9 +426,14 @@ private:
std::string Visit(Node node) {
if (const auto operation = std::get_if<OperationNode>(node)) {
const auto operation_index = static_cast<std::size_t>(operation->GetCode());
+ if (operation_index >= operation_decompilers.size()) {
+ UNREACHABLE_MSG("Out of bounds operation: {}", operation_index);
+ return {};
+ }
const auto decompiler = operation_decompilers[operation_index];
if (decompiler == nullptr) {
- UNREACHABLE_MSG("Operation decompiler {} not defined", operation_index);
+ UNREACHABLE_MSG("Undefined operation: {}", operation_index);
+ return {};
}
return (this->*decompiler)(*operation);