void SettingsDlg::isCalendar(bool goodName){ ui->calendarName->setStyleSheet( goodName ? stylegood : stylebad );}bool SettingsDlg::isCalendar(QString accountName){ isCalendar( _checkforname(QString) );}и вызов выше был: isCalendar( oldname );
C++ (Qt)#include <cstdint> int a = 0; void test0(){ a = 1;} bool test(){ test0();} int main(){ test();}
ASMtest0(): # @test0() push rbp mov rbp, rsp mov dword ptr [a], 1 pop rbp rettest(): # @test() push rbp mov rbp, rsp call test0() ud2main: # @main push rbp mov rbp, rsp sub rsp, 16 call test() xor ecx, ecx mov byte ptr [rbp - 1], al # 1-byte Spill mov eax, ecx add rsp, 16 pop rbp reta: .long 0 # 0x0
ASMtest0(): # @test0() mov dword ptr [rip + a], 1 rettest(): # @test() push rax call test0()main: # @main push rax call test()a: .long 0 # 0x0
Flowing off the end of a constructor, a destructor, or a function with a cv void return type is equivalent to a return with no operand. Otherwise, flowing off the end of a function other than main (6.6.1) results in undefined behavior.