From 13b90874f9934f0a79a9ab2b9c4e1288ed2e6764 Mon Sep 17 00:00:00 2001 From: splatoon1enjoyer <131005903+splatoon1enjoyer@users.noreply.github.com> Date: Mon, 13 May 2024 14:52:25 +0000 Subject: [PATCH] Fix commas edge case in strings when parsing an assembly line (#1201) --- src/Cemu/PPCAssembler/ppcAssembler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Cemu/PPCAssembler/ppcAssembler.cpp b/src/Cemu/PPCAssembler/ppcAssembler.cpp index 5bab7b8b..df20b21d 100644 --- a/src/Cemu/PPCAssembler/ppcAssembler.cpp +++ b/src/Cemu/PPCAssembler/ppcAssembler.cpp @@ -2418,6 +2418,9 @@ bool ppcAssembler_assembleSingleInstruction(char const* text, PPCAssemblerInOut* _ppcAssembler_translateAlias(instructionName); // parse operands internalInfo.listOperandStr.clear(); + + bool isInString = false; + while (currentPtr < endPtr) { currentPtr++; @@ -2425,7 +2428,10 @@ bool ppcAssembler_assembleSingleInstruction(char const* text, PPCAssemblerInOut* // find end of operand while (currentPtr < endPtr) { - if (*currentPtr == ',') + if (*currentPtr == '"') + isInString=!isInString; + + if (*currentPtr == ',' && !isInString) break; currentPtr++; }