From b642c5b89b3328ecdec0885cf7d5cfd3ba4dbd69 Mon Sep 17 00:00:00 2001 From: Systemcluster Date: Sun, 14 Feb 2021 10:47:30 +0100 Subject: [PATCH] [spv-in] support string instruction --- src/front/spv/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/front/spv/mod.rs b/src/front/spv/mod.rs index 2bcad16251..5b13267d81 100644 --- a/src/front/spv/mod.rs +++ b/src/front/spv/mod.rs @@ -1654,6 +1654,7 @@ impl> Parser { Op::MemoryModel => self.parse_memory_model(inst), Op::EntryPoint => self.parse_entry_point(inst), Op::ExecutionMode => self.parse_execution_mode(inst), + Op::String => self.parse_string(inst), Op::Source => self.parse_source(inst), Op::SourceExtension => self.parse_source_extension(inst), Op::Name => self.parse_name(inst), @@ -1840,6 +1841,13 @@ impl> Parser { Ok(()) } + fn parse_string(&mut self, inst: Instruction) -> Result<(), Error> { + self.switch(ModuleState::Source, inst.op)?; + inst.expect_at_least(3)?; + let (_name, _) = self.next_string(inst.wc - 1)?; + Ok(()) + } + fn parse_source(&mut self, inst: Instruction) -> Result<(), Error> { self.switch(ModuleState::Source, inst.op)?; for _ in 1..inst.wc {