Skip to content
Snippets Groups Projects
Commit 18d6325e authored by Nora Abi Akar's avatar Nora Abi Akar Committed by Sam Yates
Browse files

fix segmentation fault (#895)

* Fix modcc segmentation fault caused by improper check for the presence of a symbol, triggered when a symbol defined in a RANGE is absent from the ASSIGNED and PARAMETER blocks.
parent b014f148
No related branches found
No related tags found
No related merge requests found
...@@ -683,7 +683,7 @@ void Module::add_variables_to_symbols() { ...@@ -683,7 +683,7 @@ void Module::add_variables_to_symbols() {
// then GLOBAL variables // then GLOBAL variables
for(auto const& var : neuron_block_.globals) { for(auto const& var : neuron_block_.globals) {
if(!symbols_[var.spelling]) { if(!symbols_.count(var.spelling)) {
error( yellow(var.spelling) + error( yellow(var.spelling) +
" is declared as GLOBAL, but has not been declared in the" + " is declared as GLOBAL, but has not been declared in the" +
" ASSIGNED block", " ASSIGNED block",
...@@ -703,7 +703,7 @@ void Module::add_variables_to_symbols() { ...@@ -703,7 +703,7 @@ void Module::add_variables_to_symbols() {
// then RANGE variables // then RANGE variables
for(auto const& var : neuron_block_.ranges) { for(auto const& var : neuron_block_.ranges) {
if(!symbols_[var.spelling]) { if(!symbols_.count(var.spelling)) {
error( yellow(var.spelling) + error( yellow(var.spelling) +
" is declared as RANGE, but has not been declared in the" + " is declared as RANGE, but has not been declared in the" +
" ASSIGNED or PARAMETER block", " ASSIGNED or PARAMETER block",
......
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