Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 87eb42b

Browse files
committed
[[ IfDefLegacyExec ]] Further tweaks to eliminate false positives.
1 parent 07ca99a commit 87eb42b

File tree

12 files changed

+395
-285
lines changed

12 files changed

+395
-285
lines changed

engine/src/answer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ Exec_errors MCAnswer::exec_custom(MCExecPoint& ep, const MCString& p_stack, cons
775775
}
776776
va_end(t_args);
777777

778-
MCdialogdata -> set(ep);
778+
MCdialogdata -> store(ep, True);
779779

780780
MCStack *t_stack;
781781
t_stack = ep . getobj() -> getstack() -> findstackname(p_stack);
@@ -791,7 +791,7 @@ Exec_errors MCAnswer::exec_custom(MCExecPoint& ep, const MCString& p_stack, cons
791791
}
792792
MCtrace = t_old_trace;
793793

794-
MCdialogdata -> eval(ep);
794+
MCdialogdata -> fetch(ep);
795795

796796
return EE_UNDEFINED;
797797
}

engine/src/ask.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,16 +351,16 @@ Exec_errors MCAsk::exec_question(MCExecPoint& ep, const char *p_title)
351351
#else
352352
if (!t_error)
353353
{
354-
355-
MCAutoStringRef t_result;
356-
MCscreen -> popupaskdialog(AT_QUESTION, p_title, *t_prompt, *t_answer, question . hint, &t_result);
357-
if (*t_result != nil)
358-
/* UNCHECKED */ ep . setvalueref(*t_result);
354+
char *t_result;
355+
t_result = MCscreen -> popupaskdialog(AT_QUESTION, p_title, *t_prompt, *t_answer, question . hint);
356+
if (t_result != nil)
357+
ep . copysvalue(t_result);
359358
else
360359
{
361360
ep.clear();
362361
MCresult -> sets(MCcancelstring);
363362
}
363+
delete t_result;
364364
}
365365
#endif
366366

@@ -390,15 +390,16 @@ Exec_errors MCAsk::exec_password(MCExecPoint& ep, const char *p_title)
390390
#else
391391
if (!t_error)
392392
{
393-
MCAutoStringRef t_result;
394-
MCscreen -> popupaskdialog(AT_PASSWORD, p_title, *t_prompt, *t_answer, password . hint, &t_result);
395-
if (*t_result != nil)
396-
/* UNCHECKED */ ep . setvalueref(*t_result);
393+
char *t_result;
394+
t_result = MCscreen -> popupaskdialog(AT_PASSWORD, p_title, *t_prompt, *t_answer, password . hint);
395+
if (t_result != nil)
396+
ep . copysvalue(t_result);
397397
else
398398
{
399399
ep.clear();
400400
MCresult -> sets(MCcancelstring);
401401
}
402+
delete t_result;
402403
}
403404
#endif
404405

@@ -487,7 +488,7 @@ Exec_errors MCAsk::exec_custom(MCExecPoint& ep, bool& p_cancelled, const MCStrin
487488
}
488489
va_end(t_args);
489490

490-
MCdialogdata -> set(ep);
491+
MCdialogdata -> store(ep, True);
491492

492493
MCStack *t_stack;
493494
t_stack = ep . getobj() -> getstack() -> findstackname(p_stack);
@@ -496,15 +497,15 @@ Exec_errors MCAsk::exec_custom(MCExecPoint& ep, bool& p_cancelled, const MCStrin
496497
MCtrace = False;
497498
if (t_stack != NULL)
498499
{
499-
MCdialogdata -> set(ep);
500+
MCdialogdata -> store(ep, True);
500501
if (MCdefaultstackptr -> getopened() || MCtopstackptr == NULL)
501502
t_stack -> openrect(MCdefaultstackptr -> getrect(), sheet ? WM_SHEET : WM_MODAL, sheet ? MCdefaultstackptr: NULL, WP_DEFAULT, OP_NONE);
502503
else
503504
t_stack -> openrect(MCtopstackptr -> getrect(), sheet ? WM_SHEET : WM_MODAL, sheet ? MCtopstackptr : NULL, WP_DEFAULT, OP_NONE);
504505
}
505506
MCtrace = t_old_trace;
506507

507-
MCdialogdata -> eval(ep);
508+
MCdialogdata -> fetch(ep);
508509
if (ep . getsvalue() . getlength() == 1 && *(ep . getsvalue() . getstring()) == '\0')
509510
{
510511
ep . clear();

engine/src/cmds.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,15 +2006,15 @@ Exec_stat MCReturn::exec(MCExecPoint &ep)
20062006
MCeerror->add(EE_RETURN_BADEXP, line, pos);
20072007
return ES_ERROR;
20082008
}
2009-
MCresult -> set(ep);
2009+
MCresult -> store(ep, False);
20102010
if (url != NULL)
20112011
{
20122012
if (url->eval(ep) != ES_NORMAL)
20132013
{
20142014
MCeerror->add(EE_RETURN_BADEXP, line, pos);
20152015
return ES_ERROR;
20162016
}
2017-
MCurlresult -> set(ep);
2017+
MCurlresult -> store(ep, False);
20182018
}
20192019
else
20202020
if (var != NULL)
@@ -2024,7 +2024,7 @@ Exec_stat MCReturn::exec(MCExecPoint &ep)
20242024
MCeerror->add(EE_RETURN_BADEXP, line, pos);
20252025
return ES_ERROR;
20262026
}
2027-
MCurlresult->set(ep);
2027+
MCurlresult->store(ep, False);
20282028
var->dofree(ep);
20292029
}
20302030

engine/src/cmdsc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,7 @@ Exec_stat MCPost::exec(MCExecPoint &ep)
24912491
return ES_ERROR;
24922492
}
24932493
MCS_posttourl(ep . getobj(), ep . getsvalue(), ep2 . getcstring());
2494-
MCurlresult->eval(ep);
2494+
MCurlresult->fetch(ep);
24952495
return it->set(ep);
24962496
#endif /* MCPost */
24972497

engine/src/cmdsf.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4699,7 +4699,7 @@ Parse_stat MCWrite::parse(MCScriptPoint &sp)
46994699
Exec_stat MCWrite::exec(MCExecPoint &ep)
47004700
{
47014701
#ifdef /* MCWrite */ LEGACY_EXEC
4702-
uint2 index;
4702+
uint2 index;
47034703
IO_handle stream = NULL;
47044704
IO_stat stat = IO_NORMAL;
47054705
Boolean textmode = False;
@@ -4793,10 +4793,8 @@ uint2 index;
47934793
MCeerror->add(EE_WRITE_BADEXP, line, pos);
47944794
return ES_ERROR;
47954795
}
4796-
MCAutoStringRef t_source;
4797-
ep . copyasstringref(&t_source);
47984796
MCresult->clear(False);
4799-
MCS_write_socket(*t_source, MCsockets[index], ep.getobj(), t_message_name);
4797+
MCS_write_socket(ep.getsvalue(), MCsockets[index], ep.getobj(), t_message_name);
48004798
}
48014799
else
48024800
MCresult->sets("socket is not open");

0 commit comments

Comments
 (0)