thiagoralves / OpenPLC_v3

OpenPLC Runtime version 3
GNU General Public License v3.0
1.1k stars 442 forks source link

ISSUE-112 Fail the glue generator if the second index is out of range #114

Closed garretfick closed 4 years ago

garretfick commented 4 years ago

This ensures that if the index is out of the permitted design range, then the glue generator returns an error.

thiagoralves commented 4 years ago

Shouldn't we check pos1 as well for out of range index?

garretfick commented 4 years ago

Shouldn't we check pos1 as well for out of range index?

I've gone back and forth on this multiple times. The problem is that there is no way to know the size for sure. In general, we have a basic idea that it is 1024, but in reality, someone might define it differently and then have to change the glue generator.

The work I've been doing with glue variables also means that it is possible to support any index (except for bools), so any limit might be short lived.

garretfick commented 4 years ago

@thiagoralves is there anything that needs to be changed so that this can be merged?

thiagoralves commented 4 years ago

Nope. Just merged