Closed
Description
#1506 claimed to handle logical operations on strings, but as it turns out, things break. #2598 adds support for string literals, but the case of a string variable still fails with a segfault. The chief reason, as pointed out by @Shaikh-Ubaid is that the expr_value
of the operands, in case of a string variable, result into a nullptr
.
s_var1: str = "Hello"
s_var2: str = "LPython"
print(s_var1 or s_var2)
(base) saurabh-kumar@Awadh:~/Projects/System/lpython$ ./src/bin/lpython ./examples/example.py
Segmentation fault (core dumped)
The fix for this issue can help us to enable logical operations on string variables.
Metadata
Metadata
Assignees
Labels
No labels