mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 15:23:03 +01:00
Better handle null pointer checks in GPRE generated code
This commit is contained in:
parent
d1f8afd885
commit
2528942a8c
@ -2293,7 +2293,10 @@ static void gen_for( const act* action, int column)
|
||||
const gpre_req* request = action->act_request;
|
||||
|
||||
if (action->act_error || (action->act_flags & ACT_sql))
|
||||
success(column, true, global_status_name, " {");
|
||||
{
|
||||
printa(column, "if (%s && !(%s->getState() & Firebird::IStatus::STATE_ERRORS)) {",
|
||||
request->req_handle, global_status_name);
|
||||
}
|
||||
|
||||
printa(column, "while (1)");
|
||||
column += INDENT;
|
||||
@ -3075,11 +3078,10 @@ static void gen_s_start( const act* action, int column)
|
||||
if (action->act_error || (action->act_flags & ACT_sql))
|
||||
{
|
||||
make_ok_test(action, request, column);
|
||||
printa(column, "{");
|
||||
column += INDENT;
|
||||
}
|
||||
gen_start(action, port, column, false);
|
||||
if (action->act_error || (action->act_flags & ACT_sql))
|
||||
column -= INDENT;
|
||||
|
||||
const TEXT* pattern1 = "if (%V1->getErrors()[1] == isc_bad_req_handle) { %RH->release(); %RH = NULL; }";
|
||||
PAT args;
|
||||
@ -3088,6 +3090,12 @@ static void gen_s_start( const act* action, int column)
|
||||
PATTERN_expand((USHORT) column, pattern1, &args);
|
||||
printa(column, "else break;");
|
||||
|
||||
if (action->act_error || (action->act_flags & ACT_sql))
|
||||
{
|
||||
column -= INDENT;
|
||||
printa(column, "}");
|
||||
}
|
||||
|
||||
if (action->act_type == ACT_open)
|
||||
{
|
||||
endp(column);
|
||||
|
Loading…
Reference in New Issue
Block a user