fix: WXMLDom::RenderNonDefine内部逻辑错误

This commit is contained in:
msojocs 2023-09-23 22:57:52 +08:00
parent 88e6989060
commit 72f660ea5a
5 changed files with 21 additions and 10 deletions

View File

@ -57,10 +57,10 @@
"variant": "cpp" "variant": "cpp"
}, },
"cmake.debugConfig": { "cmake.debugConfig": {
"cwd": "/mnt/d/Work/WeChatProjects/tdesign-miniprogram-starter-retail", "cwd": "/mnt/d/Work/WeChatProjects/issue/91/build",
"args": [ "args": [
"\"--config-path\"", "\"--config-path\"",
"\"/mnt/d/Work/WeChatProjects/case4-cmd.txt\"" "\"/mnt/d/Work/WeChatProjects/issue/91/cmd/case1-cmd.txt\""
] ]
}, },
"cmake.configureSettings": { "cmake.configureSettings": {

View File

@ -1,3 +1,9 @@
## 🌈 v0.0.5 / 2023-09-23
🐞 Bug Fixes
- `WXMLDom::RenderNonDefine`: 内部逻辑错误,感谢 @Silentdoer [issue ref](https://github.com/msojocs/wechat-web-devtools-linux/issues/91)
## 🌈 v0.0.4 / 2023-08-31 ## 🌈 v0.0.4 / 2023-08-31
🐞 Bug Fixes 🐞 Bug Fixes

View File

@ -1418,7 +1418,7 @@ namespace WXML {
} }
a6 << "var " << a5 << "=_mz(z,'" << this->offset_0 << "',["; a6 << "var " << a5 << "=_mz(z,'" << this->offset_0 << "',[";
v259 = ""; v259 = "";
for (auto jj = v324.begin(); jj < v324.end(); jj++) for (auto jj = v324.begin(); jj != v324.end(); jj++)
{ {
std::string str1c = jj->first; std::string str1c = jj->first;
std::string v342; std::string v342;
@ -1428,7 +1428,8 @@ namespace WXML {
if (!strncmp(str1c.data(), "generic:", 8u)) if (!strncmp(str1c.data(), "generic:", 8u))
{ {
// jj->second. // jj->second.
_v339.emplace_back(jj->first, jj->second); _v339.emplace_back(jj->first.substr(8), jj->second);
continue;
} }
} }
else else
@ -1461,7 +1462,11 @@ namespace WXML {
a6 << "',"; a6 << "',";
if(i.second.offset_20) if(i.second.offset_20)
{ {
a6 << i.second.offset_56; a6 << (i.second.offset_56 - v274);
if (!v274)
{
v274 = i.second.offset_56;
}
} }
else else
{ {

View File

@ -25868,7 +25868,7 @@ LABEL_158:
std::string::_M_assign((int)v342, (int)jj); std::string::_M_assign((int)v342, (int)jj);
if ( !strncmp(Str1c, "generic:", 8u) ) if ( !strncmp(Str1c, "generic:", 8u) )
{ {
Str = Str1c + 8; // std::string缓冲区 Str = Str1c + 8; // 往后偏移8位
// jj + 6 -> jj.offset_24 -> jj->second // jj + 6 -> jj.offset_24 -> jj->second
WXML::DOMLib::Token::Token((int)&v345, (WXML::DOMLib::Token *)(jj + 6), v244); WXML::DOMLib::Token::Token((int)&v345, (WXML::DOMLib::Token *)(jj + 6), v244);
std::string::basic_string((void **)v347, Str); std::string::basic_string((void **)v347, Str);

View File

@ -2,7 +2,7 @@
root_dir=$(cd `dirname $0`/.. && pwd -P) root_dir=$(cd `dirname $0`/.. && pwd -P)
cd /mnt/d/Work/WeChatProjects/tdesign-miniprogram-starter-retail cd /mnt/d/Work/WeChatProjects/issue/91/build
# list="cmd1 cmd2" # list="cmd1 cmd2"
# for cmd in $list; # for cmd in $list;
@ -11,9 +11,9 @@ cd /mnt/d/Work/WeChatProjects/tdesign-miniprogram-starter-retail
# /root/github/wx-compiler/build/wcc "--config-path" "/mnt/d/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_linux.json # /root/github/wx-compiler/build/wcc "--config-path" "/mnt/d/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_linux.json
# /mnt/d/Work/disassembly/wcc-exec/wcc/wcc.exe "--config-path" "d:/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_win.json # /mnt/d/Work/disassembly/wcc-exec/wcc/wcc.exe "--config-path" "d:/Work/disassembly/wcc-exec/wcc/config/$cmd.txt" > /root/github/wx-compiler/test/wcc_win.json
# done; # done;
filename="WeChatProjects/case4-cmd.txt" filename="issue/91/cmd/case1-cmd.txt"
echo "linux:" echo "linux:"
/root/github/wx-compiler/build/wcc "--config-path" "/mnt/d/Work/$filename" > /root/github/wx-compiler/test/wcc_linux.json /root/github/wx-compiler/build/wcc "--config-path" "/mnt/d/Work/WeChatProjects/$filename" > /root/github/wx-compiler/test/wcc_linux.json
echo "windows:" echo "windows:"
/mnt/d/Work/disassembly/wcc-exec/wcc/wcc.exe "--config-path" "d:/Work/$filename" > /root/github/wx-compiler/test/wcc_win.json /mnt/d/Work/disassembly/wcc-exec/wcc/wcc.exe "--config-path" "d:/Work/WeChatProjects/$filename" > /root/github/wx-compiler/test/wcc_win.json