Skip to content

Commit d528264

Browse files
Fix wasm Failure
1 parent 482c722 commit d528264

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/bin/lpython.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,9 +1122,17 @@ namespace wasm {
11221122
compiler_options.use_colors = true; \
11231123
compiler_options.indent = true; \
11241124
Allocator al(4*1024); \
1125-
LFortran::LocationManager lm; \
11261125
LFortran::diag::Diagnostics diagnostics; \
1127-
lm.in_filename.push_back("input");
1126+
LFortran::LocationManager lm; \
1127+
{ \
1128+
LFortran::LocationManager::FileLocations fl; \
1129+
fl.in_filename = "input.txt"; \
1130+
std::ofstream out("input.txt"); \
1131+
out << input; \
1132+
lm.files.push_back(fl); \
1133+
lm.init_simple(std::string(input)); \
1134+
lm.file_ends.push_back(strlen(input)); \
1135+
}
11281136

11291137

11301138

0 commit comments

Comments
 (0)