Commit cd82fc65 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Emit a warning instead of an exception in Ada backend

in case a procedure is called but not defined. The parser should detect
it before. It triggers when using stop conditions because they are
declared exported and the script from the model checker
repo does not add the corresponding signal..
parent 02b0f616
......@@ -1501,8 +1501,10 @@ def _call_external_function(output, **kwargs):
# Not there? Impossible, the parser would have barked
raise ValueError('Probably a bug - please report'
' (related to ' + signal_name.lower() + ')')
# Can happen with stop conditions because they are defined
# as exported but the _Transition signal was not added
LOG.warning(f'Could not find signal/procedure: {signal_name} - ignoring call')
return code, local_decl
if out_sig:
for idx, param in enumerate(out.get('params') or []):
param_direction = 'in'
......@@ -1542,13 +1544,11 @@ def _call_external_function(output, **kwargs):
# Check the template in def _conditional
app_len = append_size(param)
code.append(u'{tmp}.Data (1 .. {app_len}) := {val};'
.format(tmp=tmp_id, app_len=app_len, val=p_id))
code.append(f'{tmp_id}.Data (1 .. {app_len}) := {p_id};')
if basic_param.Min != basic_param.Max:
# Append should only apply to this case, i.e.
# types of varying length...
code.append(u'{tmp}.Length := {app_len};'
.format(tmp=tmp_id, app_len=app_len))
code.append(f'{tmp_id}.Length := {app_len};')
code.append(f'{tmp_id} := {p_id};')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment