| 64 | {&builtins.intType}, builtins.byteType, true) {} |
| 65 | |
| 66 | ConstantValue eval(EvalContext& context, const Args& args, SourceRange, |
| 67 | const CallExpression::SystemCallInfo&) const final { |
| 68 | auto strCv = args[0]->eval(context); |
| 69 | auto indexCv = args[1]->eval(context); |
| 70 | if (!strCv || !indexCv) |
| 71 | return nullptr; |
| 72 | |
| 73 | const std::string& str = strCv.str(); |
| 74 | int32_t index = indexCv.integer().as<int32_t>().value(); |
| 75 | if (index < 0 || size_t(index) >= str.length()) |
| 76 | return SVInt(8, 0, false); |
| 77 | |
| 78 | return SVInt(8, uint64_t(str[size_t(index)]), false); |
| 79 | } |
| 80 | }; |
| 81 | |
| 82 | class StringUpperLowerMethod : public SimpleSystemSubroutine { |